修改前:
修改后:
plugins: [
new VueLoaderPlugin(),
new MiniCssExtractPlugin({filename: ‘styles.css’}),
new HtmlWebpackPlugin({
filename: ‘index.html’,
template: path.resolve(__dirname, ‘…/src/index.ejs’),
templateParameters(compilation, assets, options) {
return {
compilation: compilation,
webpack: compilation.getStats().toJson(),
webpackConfig: compilation.options,
htmlWebpackPlugin: {
files: assets,
options: options
},
process,
};
},
minify: {
collapseWhitespace: true,
removeAttributeQuotes: true,
removeComments: true
},</