1、安装webpack-html-plugin模块
$ npm install webpack-html-plugin —save-dev
2、webpack.config.js文件写入
var WebpackHtmlPlugin = require(‘webpack-html-plugin');
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: '[name].js'
},
plugins: [
new WebpackHtmlPlugin({
template:'forgetPass.html',
filename:'forgetPass.html'
}),
new WebpackHtmlPlugin({
template:’app/utils/crawTask/crawTaskProcess/websiteRange/failSheet.html’,
filename:'utils/crawTask/crawTaskProcess/websiteRange/failSheet.html'
})
]
码文不易,谢谢打赏