How to use HtmlWebpackPlugin for multiple template files?

I have many HTML files that I need to work with, and I use HtmlWebpackPluginto create them. Below is one of the settings for my web package:

new HtmlWebpackPlugin({
                filename: 'index.html',
                template: 'index.html',
                inject: 'body'
            }),

It works great to load a single HTML file. But can I use it to manage multiple files with a template? Like below:

new HtmlWebpackPlugin({
                    filename: '[filename].html',
                    template: 'src/components/**/*.html',
                }),
+4
source share

Source: https://habr.com/ru/post/1690162/


All Articles