Closed 951565664 closed 6 years ago
It's a convention to set NODE_ENV to production
in the build process. Libraries like react, redux will be based on this to remove debugging code for the production environment.
e.g.
If (process.env.NODE_ENV === 'production') {
Console.log('debug code');
}
After build:
If (false) {
Console.log('debug code');
}
After uglify:
So, if you want to use environment variables to distinguish the environment, you can pick another name, such as ROADHOG_ENV.
I set NODE_ENV. ...But its value is always equal to ‘production‘
I see the roadhog;s code ,
Why the variable NODE_ENV is used in roadhog, the variable NODE_ENV is often used to distinguish the test package and the formal package, if used in the roadhog, it will lead to users can not use NODE_ENV. Maybe you can use a custom variable like ROADHOG_NODE_ENV