webpackPlugin处理index.html到dist
1.webpack.config.js中导入
const HtmlWebpackPlugin = require(‘html-webpack-plugin‘)
2.pulgin中新增
new HtmlWebpackPlugin({
template:‘index.html‘
})
3.需要删除output中的如下语句
publicPath: ‘dist/‘
4.index中的如下语句
6.安装插件
npm install html-webpack-plugin@3.2.0 --save-dev
7.运行
npm run build
原文:https://www.cnblogs.com/ajaXJson/p/14912824.html