Basically I'm using babel to transpile my nodejs app so I can use es6, as well as the node-config
package.
The node-config
package by default looks for configs in the /config folder. This is reassignable by doing something like this BEFORE config is loaded.
process.env["NODE_CONFIG_DIR"] = __dirname + "/configDir/";
However, since I'm using ES6, imports are being hoisted and are always loading before any code is run.
I was wondering if there was a way I could hoist the above code above all imports so that it runs before node-config
is loaded? Or if there is perhaps another way I can tackle this problem?
Any help is appreciated!