1.0.0-beta.0 • Published 5 years ago

multpage-webpack-plugin v1.0.0-beta.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

multpage-webpack-plugin

The default entry configuration information obtained from webpack-entry-util is configured to be applied to webpack html-webpack-plugin

Installation

Use the package manager npm to install multpage-webpack-plugin

npm install multpage-webpack-plugin

Usage

const entryUtil = require("webpack-entry-util");
const MultPageWebpackPlugin = require('multpage-webpack-plugin')
const HtmlWebpackPlugin=require('html-webpack-plugin')
const entryConfig = entryUtil.getEntryFile();
const entry=entryConfig.reduce((cal, cur) => {
  const { name, entry } = cur;
  cal[name]=[entry]
})
const options={}
module.exports = {
  entry,
  plugins: [
    new MultPageWebpackPlugin(options,entryConfig,HtmlWebpackPlugin)
  ]
}

Options

You can pass a hash of configuration options to MultPageWebpackPlugin. Allowed values are as follows

NameTypeDefaultDescription
options{Object}html-webpack-plugin optionThe options with html-webpack-plugin
entryConfig{{Array.<{entry:string, template?:string,template?:string, title?:string, chunks?:string}>}}[{entry:'src/index.js',name:"main",template:'public/index.html'}]webpack-entry-util returned result set
htmlPluginHtmlWebpackPluginHtmlWebpackPluginhtml-webpack-plugin constructor

License

MIT