cross-env cross-platform set up and use environment variables
On the windows system, we use:
"SET NODE_ENV=production && webpack --config build/webpack.config.js"
On Lunix system and windows system to install and use a bash, we will use:
"EXPORT NODE_ENV=production && webpack --config build/webpack.config.js"
cross-env appeared to realize the different platforms can use a unique command, without worrying about cross-platform issues:
"cross-env NODE_ENV=production webpack --config build/webpack.config.js"
As long as the front NODE_ENV plus cross-env logo, it will help you select the appropriate commands to the NODE_ENV assignment based on the current system type.
cross-env的npm安装方式
npm install --save-dev cross-env