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

Resolve glob imports #33

Open
Yankovsky opened this issue Jun 6, 2019 · 3 comments
Open

Resolve glob imports #33

Yankovsky opened this issue Jun 6, 2019 · 3 comments

Comments

@Yankovsky
Copy link

I have following files:
src/my.css

@import "vars.css";
* {
    color: $my-color;
}

src/vars.css

$my-color: red;

and index.css

@import './src/*.css';

When I run postcss index.css I get following result:

* {
    color: $my-color;
}

$my-color: red;

If I change the name of vars.css file to something like avars.css (which comes before my.css alphabetically) or if I use specific path in index.css instead of glob everything works as expected and the result is:

$my-color: red;

* {
    color: $my-color;
}

I think it is a bug and dependencies resolution shouldn't be broken by using globs.

@Yankovsky Yankovsky reopened this Jun 6, 2019
@Yankovsky
Copy link
Author

I thought that glob pattern resolution works by first obtaining all files matching pattern and then processing them through usual resolution algorithm.

@Yankovsky
Copy link
Author

Funny thing is postcss-import pre glob removal didn't have that problem.

https://github.com/postcss/postcss-import/tree/7.1.3

@Yankovsky
Copy link
Author

Could you describe imports resolution algo?

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

1 participant