Closed uralbash closed 8 years ago
Hoping this is a quick fix i can do now. Let me take a look.
@bholloway Thanks for the quick response, I put the latest changes here https://github.com/ITCase/pyramid_sacrud/tree/materializecss
could you please try 1.4.1 (just published) as it has a little more error logging
meanwhile I am installing from your link
resolve-url-loader cannot operate: CSS error
Cannot read property 'forEach' of undefined
at visitor (/home/uralbash/Projects/pyramid_sacrud/node_modules/resolve-url-loader/index.js:138:9)
minor note: missing some items in your package.json
only other error is scss
is not found:
@import "~materialize-sass/sass/materialize.scss";
Perfect stack trace on that error message.
However it indicates a cryptic problem. It means that rework-css visitor function is being presented with a degenerate declaration.
I think I am close to building your project so I will keep going on that track.
I fixed requirements in last commit. But you can also fix it by hand:
npm i materialize-sass --save-dev
nice
I'm seeing the error now.
I can spend some minutes on it now. Local time is late here so will have to resume tomorrow if it is not a quick fix.
ok try 1.4.2 (just published)
Seems that it is possible for rework-visit to be called with missing declarations
. I have not encountered that before.
However it seems too easy an explanation. I am concerned that your CSS builds correctly and that there is not some deeper issue.
Now there is no any errors. As I understand it correctly, the output file __main.css
should replace url(...
on url(/prefix/filename)
(I asked it here http://stackoverflow.com/a/33557469/1026990). But in the output file still full path, see example:
@font-face {
font-family: "Roboto";
src: url(/home/uralbash/Projects/pyramid_sacrud/pyramid_sacrud/static/fonts/Roboto-Thin.ttf);
font-weight: 200;
}
@font-face {
font-family: "Roboto";
src: url(/home/uralbash/Projects/pyramid_sacrud/pyramid_sacrud/static/fonts/Roboto-Light.ttf);
font-weight: 300;
}
@font-face {
font-family: "Roboto";
src: url(/home/uralbash/Projects/pyramid_sacrud/pyramid_sacrud/static/fonts/Roboto-Regular.ttf);
font-weight: 400;
}
Will need to look at that link later but I will risk an answer in the mean time.
This loader will find the asset relative to the sass file with the URL statement and then write a URL relative to the compiled CSS file so that webpack can find the asset.
If webpack css loader is adding the asset files to your bundle then all is good. Absence of errors generally means yes.
However you may still need to tweak webpack output to get the final file structure you want.
I've commented on your stackoverflow issue. Let me know how you are going.
@bholloway Thanks a lot! output.publicPath
was enough for me
Solution?
I'm trying to use
resolve-url-loader
but get an error:My webpack config:
scss file: