-
-
Notifications
You must be signed in to change notification settings - Fork 609
Resolving module path when @import #117
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
Comments
You need to prefix it with
as by default webpack interprets |
@andreypopp, yes that works, but I cannot modify that CSS file, it is managed by somebody else, and every time I would do a |
@carlos- that code you are using is simply not webpack compatible then. I'd suggest opening an issue in project's issue tracker and discuss possible webpack compat. |
I believe this is a deeper problem, |
I import a css file in node_modules directory:
This is my webpack config:
I get the following error:
So when I build the project
Please help. |
I have a related issue. I want to use
and these are causing webpack to fail with errors like
the fonts are in |
This is a major issue still - I found using @import fails because it doesn't resolve the font files relative to the location of the CSS/SCSS/SASS. However if I put |
Use {
test: /\.(scss)$/,
loader: (production || testing)
? ExtractTextPlugin.extract('style-loader', 'css-loader?sourceMap!postcss-loader!resolve-url-loader?keepQuery!sass-loader?sourceMap')
: `style-loader!css-loader?sourceMap!postcss-loader!resolve-url-loader?keepQuery!sass-loader?sourceMap`
} |
/cc @michael-ciniawsky i think it is won't fixed and we can close issue, problems not in Also @import "font-awesome/css/font-awesome.css"; is not correct usage if your use import in Right use |
/cc @kroko @virtualfunction @simonh1000 @eguneys @carlos- please read comment above 😄 |
@evilebottnawi Well I did not have any issues, just noted @virtualfunction how to fight his issue. Thanks anyways. 😄 @carlos- fyi, I just revisited webpack guide that i wrote for collegues and everything (font loading, vanilla css imports) is working, feel free to take a look at |
this probrem is solved ? @CrlsMrls |
The documentation on css-loader says
@import and url(...) are interpreted like require() and will be resolved by the css-loader.
But I have an error when doing an@import
.This case fails:
But this works
I can't change it though, since this import is in a npm-managed package.
So does @import resolve module paths also? Is this related with #31?
I am using directly
css-loader
(and thenstyle-loader
) like in the Example configThe text was updated successfully, but these errors were encountered: