javascript - Object property is undefined -
i don't know if i'm missing here, reason configuration object create undefined upon using:
gulpfile.config.js
var config = { src_path: "client/" }; gulpfile.js
var config = require("./gulpfile.config.js"); gulp.task("test", function() { util.log(config.src_path); // results in 'undefined' }); do objects have initialized within scope of gulp task or there wrong object declaration?
add module.exports gulpfile.config.js,
# gulpfile.config.js var config = { src_path: "client/" }; module.exports = config module.exports object that's returned result of require call.
Comments
Post a Comment