I need all iamges to be relative to the stylesheet local. If I add root=. , which I though prepended to url(/path/) then I need to add a file-loader and the path is wrong anyway.
If I write relative path directly in the CSS then I also need to use a fileloader. If I write non-relative path in CSS then there is no change in CSS paths but images cannot be loaded since they must be relative to the stylesheet location, there is no other way for them to be loaded properly. I also use ExtractTextPlugin to have separate files for CSS but paths are wrong anyway, with or without ExtractTextPlugin.
Figured it out. Needed to add ?name=[path][name].[ext] to the file-loader.
{ test: /\.jpg$/, loader: "file-loader?name=[path][name].[ext]" }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With