Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Awesome Contribution Checklist:
sucrase
description, I can remove line break instead)Please Provide a Link A Repository for Your Addition
https://github.com/SLTKA/rollup-plugin-keep-css-imports
Please Describe Your Addition
keep-css-imports
allows to maintain the original structure of style imports (CSS, SCSS, or SASS) without altering them during the bundling process. It will be helpful for building a components library and want to keep all CSS module imports untouched so consumer decide how to bundle or tree shake them.If it meets SASS or SCSS import it will compile it and output as a single imported CSS file in
dist
. Plugin can be configured to maintain component folder structure or produce flattened output.Rollup and Webpack based consumers can easily ignore the produced CSS file if component imported them was not used.
This is an alternative to CSS-in-JS plugins and allow consumers to produce separate Server Side Rendered HTML and CSS which loads much faster than dynamic (forces to wait for JS to run to inject CSS) or inline (doesn't allow separate CSS files caching in browsers) CSS-in-JS