我有preprocess bundle.js . -FULL=true > bundle.full.js
(https://www.npmjs.com/package/preprocessor)来运行javascript的预处理。我的webpack.config.js在下面,
var webpack = require('webpack');
var PROD = JSON.parse(process.env.PROD_ENV || '0');
module.exports = {
entry: "./bootstrap.js",
devtool: 'source-map',
output: {
path: __dirname,
filename: PROD ? 'bundle.min.js' : 'bundle.js'
},
plugins: PROD ? [
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }
})
] : [],
module: {
loaders: [
{ test: /\.css$/, loader: "style!css" }
]
}
};
如何将预处理命令添加到配置中以使其自动运行?