-
-
Notifications
You must be signed in to change notification settings - Fork 430
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
Handle CSS imports correctly #138
Comments
What is the webpack.config.js in your case? Does |
+1 same here |
Yep, this is what I was talking about in #101 Just a reminder, the css file cannot be just treated as scss... the url refs in the css file should be relative to that css file. |
after looking into how sass does things, i actually am starting to think the behavior just needs to make sure the compiled sass has what the css/style loader needs to consume those references. In webpack, is it the loader's responsibility to offer new imports to webpack to consume? or should the piped output from the sass loader into css-loader be sufficient? |
#138 New algorithm: - Imports with no file extension: - Prefer modules starting with '_' - File extension precedence: .scss, .sass, .css - Imports with file extension: - If the file is a CSS-file, do not include it all - The exact file name must match This is how node-sass does it.
Could you check out the current master branch and check if it works for you? I've heavily refactored the import mechanism and need more tests. |
Fixed with 2.0.0 |
It looks like the CSS content is being interpreted as SCSS and using the same 'pwd' (for lack of a better term) so a fonts css file with the content below looks at the main SCSS's path instead of the imported CSS's path and icomoon.woff/svg files get the lovely
|
Oh, wait... leaving the .css extension on the import, webpack is now correctly handling them. Sweet. :) looks good! |
node-sass treats CSS imports this way:
If a file ending is provided...
...the import statement stays untouched, but the file contents are not included:
becomes
If no file ending is provided...
...it is treated as
scss
and included.The sass-loader should treat it the same way. Currently the sass-loader outputs an absolute path to the CSS file which is pretty useless.
The text was updated successfully, but these errors were encountered: