plugins: [
// new CleanWebpackPlugin(['static']),
new CleanWebpackPlugin(pathsToClean, cleanOptions),
new webpack.optimize.CommonsChunkPlugin({
// names: ['jquery','vendor','runtime'],
// names: ['jquery','echarts','highcharts','vendor'],//跟页面插入的顺序相反
// names: ['echarts','highcharts','vendor'],
// names: ['highcharts','vendor'],
names: ['vendor'],
minChunks: Infinity
}),
new HtmlWebpackPlugin({
title: 'Output Management',
//excludeAssets: [/style.*.js/] // exclude style.js or style.[chunkhash].js
}),
new HtmlWebpackExcludeAssetsPlugin(),
new webpack.DefinePlugin({
'process.env':{
'NODE_ENV': JSON.stringify('production')
}
})
/*
new webpack.ProvidePlugin({ // 将 $ 变量挂载到 window 下面,可以在项目中直接使用 $ 不用再引用
$:"jquery",
jQuery:"jquery",
"window.jQuery":"jquery"
})
*/
]
vue-cli的配置
另有一篇文章