-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
import url? #23
Comments
Seems like a bug to me, but I don't know what the problem is. @sokra it's probably because webpack passes the preprocessed css-file (which is now a js-file) to less? I've added a test-case to demonstrate that import urls are supported. |
{ test: /\.less$/, loader: 'less' }, should be { test: /\.less$/, loader: 'style!css!less' }, |
but the material-ui stuff is buggy in another way: webpack-contrib/css-loader#24 (comment) |
Im skipping the style!css! part to try and find out what's bothering the less loader, since the faulty output from the less loader will just blow up the css loader, as per the css-loader#24 issue. |
You can try { test: /\.less$/, loader: 'style!raw!less' }, |
That seems to work, thanks! So how does it work, is the raw loader simply consuming and ignoring errors from the less loader and spewing out whatever style string it can? |
The css-loader parses the CSS for dependencies i. e. So you loose the image handling if you use the raw-loader instead of the css-loader... |
So Im probably loosing all the fonts then? |
@mg were you able to load the fonts finally? |
As workaround you could create a loader that fixes the css: // css-fix-loader.js
module.exports = function(source) {
this.cachable();
return source.replace(/\};/g, "}");
}; module.loaders: [
{ test: /\.less$/, loaders: [
"style-loader",
"css-loader",
require.resolve("./css-fix-loader.js"),
"less-loader"
] }
] |
That works. Thanks! But some animations are missing from the compiled code, which is expected in this case, i guess. Also, a small typo in your post - |
Hi, Im trying to parse the LESS from the material-ui.com project and get the following error:
Heres my webpack config:
and the materialui.
Do I need some special loader for url or is there something else going on here?
The text was updated successfully, but these errors were encountered: