htmlWebpackPlugin add only one entry point to the generated html
Seems you can use html-webpack-exclude-assets-plugin
plugins: [
new HtmlWebpackPlugin({
excludeAssets: [/style.*.js/] // exclude style.js or style.[chunkhash].js
}),
new HtmlWebpackExcludeAssetsPlugin()
]
The chunks
option is probably what you want to use (see the filtering chunks section of the documentation). I don't know why it's commented in your snippet but you could write this:
entry: {
background: './app/main/background.js',
options: './app/main/options.js'
}
If you want to only inject the options
entrypoint in the generated HTML, specify the chunks:
new HtmlWebpackPlugin({
template :'./app/templates/options.html',
chunks : ['options'],
filename: "./options.html",
cache : true
}),