3.2.2 • Published 5 years ago

@enyobao/multihtml-webpack-plugin v3.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago
  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。