@enyobao/multihtml-webpack-plugin
v3.2.2
Published
Simplifies creation of HTML files to serve your webpack bundles
Downloads
8
Maintainers
Readme
npm i --save-dev @enyobao/multihtml-webpack-plugin
yarn add --dev @enyobao/multihtml-webpack-plugin
配置多入口文件
webpack.config.js
const HtmlWebpackPlugin = require('multihtml-webpack-plugin')
module.exports = {
entry: 'index.js',
output: {
path: __dirname + '/dist',
filename: 'index_bundle.js'
},
plugins: [
new HtmlWebpackPlugin({
multihtmlCache: true, // 设置多入口缓存,默认false
...其他配置
}), // Generates default index.html
new HtmlWebpackPlugin({ // Also generate a test.html
filename: 'test.html',
template: 'src/assets/test.html',
multihtmlCache: true, // 设置多入口缓存,默认false
...其他配置
})
]
}
其他配置请参考html-webpack-plugin。