Anidetrix / rollup-plugin-styles

🎨 Universal Rollup plugin for styles: PostCSS, Sass, Less, Stylus and more.
https://anidetrix.github.io/rollup-plugin-styles
MIT License
243 stars 43 forks source link

mode extract missing files #124

Closed atompkins closed 4 years ago

atompkins commented 4 years ago

So my use case is that I want all of the css to be bundled into a single file. Is this supported? The closest I have got so far is to use mode: ['extract', 'filename.css'] Even though I have provided the output filename it still respects assetFileNames so I changed this to '[name][extname]' Luckily I don't have any other assets so this isn't causing an issue.

Whenever I provide a filename for the extract output I loose files. The missing ones tend to be top level imports, code split modules seems to come through OK.

Default mode injection works fine, I just don't want my js bloated with css. Extract without a filename seems to work OK, just lots of files.

Anidetrix commented 4 years ago

Hi @atompkins,

So my use case is that I want all of the css to be bundled into a single file. Is this supported?

Yes it is.

The closest I have got so far is to use mode: ['extract', 'filename.css']

Yes, that's the correct way to do it.

Even though I have provided the output filename it still respects assetFileNames so I changed this to '[name][extname]'

That's intended, that way rollup can generate hash itself when using [hash] placeholder. But I think I should change it in the 4.0 release.

Whenever I provide a filename for the extract output I loose files. The missing ones tend to be top level imports, code split modules seems to come through OK.

I think I'll need a minimal reproduction repo for that. Can you make one using rollup's REPL, REPL.it, or just GitHub repo?

atompkins commented 4 years ago

I think this shows the problem: https://repl.it/@PointyHair/rollup-repro

Anidetrix commented 4 years ago

Hmm, seems like a bug indeed, going to fix that and let you know.

Anidetrix commented 4 years ago

Hi again @atompkins,

Seems like I fixed it, fix is included in the 3.10.0 release.

Let me know if it works for you!

atompkins commented 4 years ago

Yes it does, thank you :)