-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
CSS files being compiled with PostCSS before they're imported #609
Comments
It appears that PostCSS files are compiled, but only seperately, before they are imported. It just imports variables and functions without checking if they are being used in other files. I tried several methods to fix this, and they didn't work. Maybe a 'best practice' in the documentation (on how to work with variables and/or functions across different files) would solve some things? |
@agepoor Ah, you're right. I see now that the CSS files are being compiled, but before they're imported. I should update the title and description of the issue. Unfortunately, imports should typically be the first thing to run in a PostCSS config: https://github.com/postcss/postcss-import
|
Can @agepoor or anyone on the Parcel team comment on whether there has been any headway made on this issue? I am using parcel on a current project, but I will have to pivot to using webpack if I can't get postcss-import to work properly. Other that this issue, parcel is working great for us and I would really prefer to stick with it if possible. |
I didn't get a response from the team, so I used a workaround by running a watch script for the CSS files doing just the imports and make parcel 'watch' the output file. |
Any update on this? its a very crucial feature and its a surprised this the parcel team hasnt addressed it @devongovett |
what happens when official css variables (the ones prefixed with |
Having the same problem with postcss-extend Plugin when using it across two files. Any news on this issue? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
🐛
CSS files appear to be compiling with PostCSS before they're imported. This will lead to unexpected behavior in most PostCSS builds, as imports are typically the first thing that should run. See:
https://github.com/postcss/postcss-import
Possibly related to #329 and #593.
🎛 Configuration
package.json
postcss.config.js
index.html
assets/css/index.css
assets/css/global/colors.css
🤔 Expected Behavior
😯 Current Behavior
💁 Possible Solution
It appears that CSS imports will work even without requiring a PostCSS plugin like
postcss-easy-import
. Because different import plugins can behave differently, and because the order of PostCSS plugins is very important, I believe CSS import behavior should be left completely up to the PostCSS config and plugin.🔦 Context
This config works with webpack + postcss-loader, and gulp.
💻 Code Sample
https://github.com/jonmilner/parcel-test
🌍 Your Environment
The text was updated successfully, but these errors were encountered: