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

Usage with postcss-import and postcss-mixins #108

Open
penx opened this issue Oct 17, 2017 · 0 comments
Open

Usage with postcss-import and postcss-mixins #108

penx opened this issue Oct 17, 2017 · 0 comments

Comments

@penx
Copy link

penx commented Oct 17, 2017

See this example project:

https://github.com/penx/postcss-import-values-mixins

I have a css file (src/main.css) that imports another CSS file with a mixin:

@import "./mixins/fonts";

The mixin css file loads a variable:

@value title_font from '../variables/fonts.css';

But when running npm run webpack, I receive the error:

    ERROR in ./node_modules/css-loader?{"importLoaders":1}!./node_modules/postcss-loader/lib!./src/main.css
    Module not found: Error: Can't resolve '../variables/fonts.css' in '/postcss-import-values-mixins/src'

If I change the path to the variables css file to this:

@value title_font from './variables/fonts.css';

(using . rather than ..)

...then it works. But this is not the correct path relative to the file it is in.

This seems to indicate that postcss is trying to process the path to the src/variables/fonts.css file relative to src/main.css, rather than relative to src/mixins/fonts.css.

Is this a bug, or is there an issue with my configuration?

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