Dev environment starts with this command:
nodemon -w src --exec \"babel-node src --presets es2015,stage-0\"
How do i create a global variable (or process.env
variable) __DEV__ = true
?
You can either add "env"
property to nodemon.json
, like this:
...
"env": {
"__DEV__": "true"
}
Or you can prepend __DEV__="true"
to start
script in package.json
.
Both worked for me.
You can add a "nodemonConfig" property to package.json with your env info. Then execute nodemon in your scripts section.
"nodemonConfig": {
"restartable": "rs",
"ignore": [
"node_modules/**/node_modules"
],
"delay": "2500",
"env": {
"NODE_ENV": "development",
"NODE_CONFIG_DIR": "./config"
}
}
For windows: set __DEV__ = true&&nodemon -w src --exec \"babel-node src --presets es2015,stage-0\
"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With