css-loader: :local + url(File) - unexpected behaviour
this works well
:local(.selectLocale) {
background: url(SelectLocale72x72.png) no-repeat 90% #eee;
}
This (without brackets)
:local .selectLocale {
background: url(SelectLocale72x72.png) no-repeat 90% #eee;
}
throws an error
ERROR in ./~/css-loader!./~/cssnext-loader!./src/components/SelectLocale.css
Module not found: Error: Cannot resolve module 'SelectLocale72x72.png'
That’s a bug, right? Or I missed something? What form should I use? Very confusing and unexpected. I’ve read a mention about that, but it explained nothing to me 😦
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 19 (6 by maintainers)
Please reopen the issue. It still exists more than one year, css-loader cannot resolve url without
modules: true
.the issue is caused by
cssnano
that I use as one of PostCSS plugins. the trick is to force setnormalizeUrl: false
which apparently is set to true by default. 🤦♂️