domingues / rollup-plugin-css-chunks

Rollup plugin to extract CSS into chunks
MIT License
14 stars 8 forks source link

What does injectImports do? #18

Closed benmccann closed 3 years ago

benmccann commented 3 years ago

Whether I turn it on or off I don't see any difference, but I suspect I don't quite understand when it's being called or what it's doing.

Do you put an import statement in your JS and then it translates it to a CSS import statement? Does it prevent the CSS from being concatenated into a single CSS chunk that case? Will it act on all CSS modules in the chunk or only some?

domingues commented 3 years ago

It puts CSS @import directives for each chunk it depends on.

benmccann commented 3 years ago

Thanks. I got it to trigger. I'm not quite sure what the difficulty I was having was. I'll raise a PR to expand the docs just slightly with your explanation