Closed xmlking closed 10 years ago
Sorry for the delay here @xmlking!
Unfortunately, no, it's not possible to share a variable across files. This is a limitation (by design) of Node. Your only option would be to move that variable to a shared file/module.
Hope that helps!
global.env = process.env.NODE_ENV || 'DEV';
in other module
console.log(env);
This works but, order of code execution is not garented. See : https://github.com/lorenwest/node-config/issues/246
I have a main file
gulpfile.js
with variableenv
initialized.I want to use
env
in./gulp/build.js
may be in some other child file , i want to override
env
global variable. is it possible ?