rollup-plugin-css-only icon indicating copy to clipboard operation
rollup-plugin-css-only copied to clipboard

Nested import handling

Open jerekshoe opened this issue 4 years ago • 3 comments

When css is imported from modules that are being imported themselves, I'm uncertain if the order is as it should be. I'm coming from using css-loader with webpack, which from what I have seen handles css imports the same way that javascript imports are handled (i.e. each imported modules code/imports are executed recursively before the next import statement is handled). This seems to contradict #16, however, so I'm curious what the intended functionality is for this plugin.

Code

main.js

import './a.js';
import './a.css';

a.js

import './b.css';

a.css

body {
    background-color: red;
}

b.css

body {
    background-color: blue;
}

Expected Behavior (What I would expect)

bundle.css

body {
    background-color: blue;
}body {
    background-color: red;
}

Actual Behavior

bundle.css

body {
    background-color: red;
}body {
    background-color: blue;
}

jerekshoe avatar Dec 25 '20 06:12 jerekshoe

I'd be willing to make a PR to change this if desired

jerekshoe avatar Jan 11 '21 04:01 jerekshoe

I would be happy to merge that!

thgh avatar Jan 15 '21 20:01 thgh

Hi! I added you and @jerekshoe as collaborators, added a v4 branch and updated the README for v4. Do you see anything else that should be included in the release?

thgh avatar Feb 03 '21 14:02 thgh