rollup-plugin-styles
rollup-plugin-styles copied to clipboard
`preserveModules`, but keep and entry point with `@import`
I'm trying to use preserveModules: true
primarily for JS code, but this has a confusing output for CSS files.
Input
/* main.js */
import './alpha.css';
import './beta.css';
console.log('hi')
/* alpha.css */
html {color: red;}
/* beta.css */
body {font-weight: bold}
Current output
/* main.js */
console.log('hi')
/* main.css */
html {color: red;}
body {font-weight: bold}
/* alpha.css */
html {color: red;}
/* beta.css */
body {font-weight: bold}
Expected output
One of:
-
only
main.css
(ignoringpreserveModule
, which I don't need for CSS) -
alpha.css
,beta.css
, and amain.css
that looks like@import 'alpha.css';@import 'beta.css'
Final notes
I'm mostly ok with the current behavior as the duplicate CSS is minor and inert, but I'm afraid that this is considered a "bug" and it might be "fixed" in a way that doesn't match my expectations (i.e. main.css
is no longer created or it's empty, without imports)
Related
- https://github.com/Anidetrix/rollup-plugin-styles/issues/130