|
@@ -62,22 +62,26 @@ const webpackConfig = merge(baseWebpackConfig, {
|
|
|
// generate dist index.html with correct asset hash for caching.
|
|
// generate dist index.html with correct asset hash for caching.
|
|
|
// you can customize output by editing /index.html
|
|
// you can customize output by editing /index.html
|
|
|
// see https://github.com/ampedandwired/html-webpack-plugin
|
|
// see https://github.com/ampedandwired/html-webpack-plugin
|
|
|
- new HtmlWebpackPlugin({
|
|
|
|
|
- filename: process.env.NODE_ENV === 'testing'
|
|
|
|
|
- ? 'index.html'
|
|
|
|
|
- : config.build.index,
|
|
|
|
|
- template: 'index.html',
|
|
|
|
|
- inject: true,
|
|
|
|
|
- minify: {
|
|
|
|
|
- removeComments: true,
|
|
|
|
|
- collapseWhitespace: true,
|
|
|
|
|
- removeAttributeQuotes: true
|
|
|
|
|
- // more options:
|
|
|
|
|
- // https://github.com/kangax/html-minifier#options-quick-reference
|
|
|
|
|
- },
|
|
|
|
|
- // necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
|
|
|
|
- chunksSortMode: 'dependency'
|
|
|
|
|
- }),
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /* 注释这个区域的内容 ---------------------- 开始 */
|
|
|
|
|
+ // new HtmlWebpackPlugin({
|
|
|
|
|
+ // filename: process.env.NODE_ENV === 'testing'
|
|
|
|
|
+ // ? 'index.html'
|
|
|
|
|
+ // : config.build.index,
|
|
|
|
|
+ // template: 'index.html',
|
|
|
|
|
+ // inject: true,
|
|
|
|
|
+ // minify: {
|
|
|
|
|
+ // removeComments: true,
|
|
|
|
|
+ // collapseWhitespace: true,
|
|
|
|
|
+ // removeAttributeQuotes: true
|
|
|
|
|
+ // // more options:
|
|
|
|
|
+ // // https://github.com/kangax/html-minifier#options-quick-reference
|
|
|
|
|
+ // },
|
|
|
|
|
+ // // necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
|
|
|
|
+ // chunksSortMode: 'dependency'
|
|
|
|
|
+ // }),
|
|
|
|
|
+ /* 注释这个区域的内容 ---------------------- 结束 */
|
|
|
|
|
+
|
|
|
// keep module.id stable when vendor modules does not change
|
|
// keep module.id stable when vendor modules does not change
|
|
|
new webpack.HashedModuleIdsPlugin(),
|
|
new webpack.HashedModuleIdsPlugin(),
|
|
|
// enable scope hoisting
|
|
// enable scope hoisting
|
|
@@ -120,7 +124,8 @@ const webpackConfig = merge(baseWebpackConfig, {
|
|
|
ignore: ['.*']
|
|
ignore: ['.*']
|
|
|
}
|
|
}
|
|
|
])
|
|
])
|
|
|
- ]
|
|
|
|
|
|
|
+ /* 该位置添加 .concat(utils.htmlPlugin()) ------------------- */
|
|
|
|
|
+ ].concat(utils.htmlPlugin())
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
if (config.build.productionGzip) {
|
|
if (config.build.productionGzip) {
|