Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested import handling #28

Open
jerekshoe opened this issue Dec 25, 2020 · 3 comments
Open

Nested import handling #28

jerekshoe opened this issue Dec 25, 2020 · 3 comments

Comments

@jerekshoe
Copy link
Collaborator

jerekshoe commented Dec 25, 2020

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 jerekshoe changed the title Nested imports improperly handled Nested import handling Dec 25, 2020
@jerekshoe
Copy link
Collaborator Author

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

@thgh
Copy link
Owner

thgh commented Jan 15, 2021

I would be happy to merge that!

@thgh
Copy link
Owner

thgh commented Feb 3, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants