runjuu/html-inline-css-webpack-plugin

Split CSS across multiple files

Volper212 opened this issue · 1 comments

I have a couple of .scss files and I want to specify which files are inlined in which .html files. How do I do that? Right now all entry .scss files are inlined in every result .html file, which is not what I want. Here's the relevant plugin config:

new MiniCssExtractPlugin(),
...files.map(file => new HtmlWebpackPlugin({
    template: `src/pug/${file}.pug`,
    filename: `${file}.html`,
    templateParameters: {
        filename: file
    },
    inject: false
})),
new HTMLInlineCSSWebpackPlugin(),

Even though I did inject: false your plugin still injects every entry style file into the <head>.

Figured it out. Turns out one can use the chunks property for this.