callstack / linaria

Zero-runtime CSS in JS library
https://linaria.dev
MIT License
11.68k stars 417 forks source link

rollup: option to keep generated css imports #703

Open jackmellis opened 3 years ago

jackmellis commented 3 years ago

The current behaviour of the rollup plugin is to extract styles to a css file and then remove it from the js. This means the consumer has to manually import the js and css separately.

Sometimes (especially when writing internal packages) it's preferable to have the package manage its own css imports, so it'd be great if there was the option to leave the css imports in.

We have forked and implemented this behaviour internally so it's definitely possible.

Anber commented 3 years ago

Hi @jackmellis

Since you have it implemented, maybe you can try to make a PR?

jackmellis commented 3 years ago

Hi @Anber is there an easy way to test the linaria suite locally? I don't think it's as simple as yarn link (having branched from master)

Anber commented 3 years ago

Hi @jackmellis

yarn link works well for me.

Bohdan-Anderson-Rangle commented 1 year ago

@jackmellis Where you able to make a PR for this? Could you point me towards how you prevented rollup from removing the imports?