Skip to content

Split CSS across multiple files #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Volper212 opened this issue Feb 13, 2021 · 1 comment
Closed

Split CSS across multiple files #34

Volper212 opened this issue Feb 13, 2021 · 1 comment

Comments

@Volper212
Copy link

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>.

@Volper212
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant