-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
Cannot import CSS files #101
Comments
+1 |
5 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1! |
Can you try the changes in PR #116 to see if it is fixed? |
+1 |
1 similar comment
+1 |
@jhnns I think this issue needs reopening. in the example in #91 about my fonts.scss file... the compiled output does not include the contents of the See: (newlines added for readability) @import url(/Users/jgrimes/Workspace/nti.web.mobile/src/main/resources/fonts/droid-serif/index.css);
@import url(/Users/jgrimes/Workspace/nti.web.mobile/src/main/resources/fonts/foundation-icons/index.css);
@import url(/Users/jgrimes/Workspace/nti.web.mobile/src/main/resources/fonts/open-sans/index.css);
@import url(/Users/jgrimes/Workspace/nti.web.mobile/src/main/resources/fonts/open-sans-condensed/index.css);
@import url(/Users/jgrimes/Workspace/nti.web.mobile/src/main/resources/fonts/stix/index.css);
@import url(/Users/jgrimes/Workspace/nti.web.mobile/src/main/resources/fonts/symbola/index.css);
@import url(/Users/jgrimes/Workspace/nti.web.mobile/src/main/resources/fonts/icomoon/style.css);
... Those file paths are correct (from the file system's perspective)... I would expect the contents of the css file to be inlined. Update: I do not believe sass-loader inlined them before, I believe the loader offered the css files back to webpack to deal with them. |
I think I understand some of this more... Sass will compile WebPack may not be given the opportunity to re-resolve the css file and pack it in. |
Could you guys check out the current master branch and check if it works for you? I've heavily refactored the import mechanism and need more tests. |
So, CSS files are being imported. yay! However, the references in them to fonts and images are not respecting the CSS path. (relative urls in plain css are relative to the css file's path) |
Disregard. :) leaving the |
Does anyone know why there is a difference? |
@jorrit If my understanding is correct, not including an extension the loader looks for .sass, .scss and .css...but treats them as if they were sass. With an extension, it seem to be passing it to webpack (as it should be) Perhaps, the css _without_ extension should log a warning letting the author know that this style of import is quirky. (And probably not what they intended) |
@jsg2021 When you add the This is how libsass handles it, the sass-loader is just imitating it. |
@jhnns I think thats perfect. |
@jhnns Is this still the expected behavoir? Because if I omit |
I have a setup like this in my main
Naturally the Sass libraries are relative to the Sass file they are imported into, but the CSS libraries are relative to the output CSS file. Above, Trying to compile the above with Webpack sass-loader results in the following error:
However, if I change the above to:
It appears to work properly. I would like my app to not depend upon Webpack and compile with regular Sass - is there anyway to do this without modifying my |
I have the same issue. Wonder if this is being looked at. |
#91 (comment)
The text was updated successfully, but these errors were encountered: