|
@@ -21,10 +21,10 @@ 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: 'vendors',
|
|
|
+ minChunks: 4
|
|
|
+ }),
|
|
|
// new webpack.optimize.CommonsChunkPlugin({
|
|
|
// name: 'vendor',
|
|
|
// minChunks: function (module) {
|
|
@@ -42,24 +42,24 @@ module.exports = (function () {
|
|
|
// chunks: ['vendor']
|
|
|
// }),
|
|
|
|
|
|
- /* 配置好Dll */
|
|
|
- new webpack.DllReferencePlugin({
|
|
|
- context: dirVars.staticRootDir, // 指定一个路径作为上下文环境,需要与DllPlugin的context参数保持一致,建议统一设置为项目根目录
|
|
|
- manifest: require('./dll/'+argv.env.deploy+'/manifest.json') // 指定manifest.json
|
|
|
- }),
|
|
|
- // 把dll文件复制到打包后的文件中
|
|
|
- new CopyWebpackPlugin([
|
|
|
- {
|
|
|
- from: path.resolve('./dll/'+argv.env.deploy),
|
|
|
- to: (__dirname, './'),
|
|
|
- ignore: ['.*']
|
|
|
- }
|
|
|
- ]),
|
|
|
- // 将 dll.js 插入HTML里
|
|
|
- new HtmlWebpackIncludeAssetsPlugin({
|
|
|
- assets: [(__dirname, 'vendors.js'),(__dirname, 'vendors.css')],
|
|
|
- append: false
|
|
|
- }),
|
|
|
+ // /* 配置好Dll */
|
|
|
+ // new webpack.DllReferencePlugin({
|
|
|
+ // context: dirVars.staticRootDir, // 指定一个路径作为上下文环境,需要与DllPlugin的context参数保持一致,建议统一设置为项目根目录
|
|
|
+ // manifest: require('./dll/'+argv.env.deploy+'/manifest.json') // 指定manifest.json
|
|
|
+ // }),
|
|
|
+ // // 把dll文件复制到打包后的文件中
|
|
|
+ // new CopyWebpackPlugin([
|
|
|
+ // {
|
|
|
+ // from: path.resolve('./dll/'+argv.env.deploy),
|
|
|
+ // to: (__dirname, './'),
|
|
|
+ // ignore: ['.*']
|
|
|
+ // }
|
|
|
+ // ]),
|
|
|
+ // // 将 dll.js 插入HTML里
|
|
|
+ // new HtmlWebpackIncludeAssetsPlugin({
|
|
|
+ // assets: [(__dirname, 'vendors.js'),(__dirname, 'vendors.css')],
|
|
|
+ // append: false
|
|
|
+ // }),
|
|
|
|
|
|
new ExtractTextPlugin({
|
|
|
filename: "[name].css",
|