Closed Hery103 closed 5 years ago
If I understand correctly then webpack is compiling without error.
If so that means that sass and resolve-url-loader are working.
The final path that webpack writes is a separate concern. The publicPath you supplied is prepended to give the final uri.
It sounds like your web server isn’t serving the asset on this uri.
@bholloway Yes that's right ! Original image is assets/images/close.png My browser developper tools point to ----> /web/images/close.d9d2d0b1.png -----> nothing appear Image is compiled in /web/build/images/close.d9d2d0b1.png I tried to copy directly "close.d9d2d0b1.png" into web/images ---> Nothing happens on browser
I think Resolve url loader is the solution but how insert your follow exemple on my webpack.config.js ----> Resolve url loader exemple
@Hery-Rs please take a look at resolve-url-loader@next for better instructions. This new version will be released within the week 🤞 so maybe best to start there.
From what I can tell you want the file outputted to /web/images/close.d9d2d0b1.png
but you are getting /web/build/images/close.d9d2d0b1.png
.
If so then it looks like a mismatch between your output path and public path. Either use .setOutputPath('web')
or else .setPublicPath('/web/build')
.
I am not sure where /images
comes from though. Maybe that is the default for Encore
?
@Hery-Rs I'm going to close this issue. Although this is out of scope of resolve-url-loader
I hope that I was helpful.
Hello This is my first Issue :-)
Background Url() in my compiled scss doesn't appear. I follow Sass Loader documentation, i install "Resolve Url loader", and i try to look at other Issues related the same Pb, but I don't understand how to resolve it with my configuration :
The Url is compiled to --------->
background: url(/web/images/close.d9d2d0b1.png);
How can i set my "webpack.config.js" ? I tried to install "Resolve Url loader", but how to adapt it and where can i insert the example of documentation in my code ?
Thanks I'm Newbieeee :-)