egoist / egoist/rollup-plugin-postcss

[feature] linkTag injection type

Open
#319 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
689
Forks
210
PR merge metrics
No merged PRs in 30d

Description

[Webpack's style-loader has several different `injectType`s](https://webpack.js.org/loaders/style-loader/#injecttype). It would be nice if some of these options were supported here as well. My motivation for asking is that I'm wondering if the number of `style` tags created by the plugin today would result in optimal performance. It seems like we could recalculate the CSSOM fewer times by injecting only a single `style` tag per chunk. And injecting the styles via a `link` tag might result in reduced data transfer for hydrated apps, which would be quite nice

I think that [the `extract` option in this plugin](https://github.com/egoist/rollup-plugin-postcss#extract) creates only a single CSS file? It would be nice if there were a way to create one css chunk per js chunk in order to support this feature. Then I might be able to provide a function to `inject` in order to write the `link` tag myself.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.