Answer the question
In order to leave comments, you need to log in
How to work with multiple html in webpack?
Is it possible to specify in html-webpacl-plugin which script and style files it should prescribe for itself in order to work with 2 or more html files?
After all, if you create 2 instances of html-webpacl-plugin, then they will take the same style files and scripts.
Answer the question
In order to leave comments, you need to log in
If I understood you correctly, then you need to set up chunks for two different instances. For example:
new HtmlWebpackPlugin({
template: __dirname + "/pages/main/main.html",
chunks: ['main'],
filename: './main.html',
inject: 'body'
}),
new HtmlWebpackPlugin({
template: __dirname + "/pages/catalog/catalog.html",
chunks: ['catalog'],
filename: './catalog.html',
inject: 'body'
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question