webpack Vue条件编译
package.json
yarn add cross-env -D
1 | "dev_test": "cross-env NODE_ENV=development TYPE=test webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", |
build/webpack.dev.conf.js & webpack.prod.conf.js
1 | var env; |
config/index.js
1 | // index: path.resolve(__dirname, '../dist/index.html'), |
config/prod.env.js
1 | module.exports = { |
config/test.env.js
1 | module.exports = { |
使用
process.env.CLIENT