|
@@ -17,9 +17,25 @@ let isDev = isWatch || argv.env.deploy == 'dev';
|
|
|
|
|
|
module.exports = (function () {
|
|
|
let plugins = [
|
|
|
+ // new webpack.optimize.CommonsChunkPlugin({
|
|
|
+ // name: 'vendors',
|
|
|
+ // minChunks: 4
|
|
|
+ // }),
|
|
|
+ new webpack.optimize.CommonsChunkPlugin({
|
|
|
+ name: 'vendor',
|
|
|
+ minChunks: function (module) {
|
|
|
+ return (
|
|
|
+ module.resource &&
|
|
|
+ /\.js$/.test(module.resource) &&
|
|
|
+ module.resource.indexOf(
|
|
|
+ path.join(__dirname, '../node_modules')
|
|
|
+ ) === 0
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }),
|
|
|
new webpack.optimize.CommonsChunkPlugin({
|
|
|
name: 'vendors',
|
|
|
- minChunks: 4
|
|
|
+ chunks: ['vendor']
|
|
|
}),
|
|
|
new ExtractTextPlugin({
|
|
|
filename: "[name].css",
|
|
@@ -41,7 +57,7 @@ module.exports = (function () {
|
|
|
title: '搜索页',
|
|
|
filename: 'html/index.html',
|
|
|
template: './template/search.html',
|
|
|
- chunks: ['vendors','search']
|
|
|
+ chunks: ['vendors','search'],
|
|
|
}),
|
|
|
// new HtmlWebpackPlugin({
|
|
|
// title: '支付跳转页面',
|