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 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)
]
}
Options
You can pass a hash of configuration options to MultPageWebpackPlugin
.
Allowed values are as follows
Name | Type | Default | Description |
---|---|---|---|
options |
{Object} |
html-webpack-plugin option |
The 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 |