Answer the question
In order to leave comments, you need to log in
How to configure webpack resolve-url-plugin correctly?
I have a project
src
---components
------header
---------header.scss
---public
------img
---------header-background.png
.header{
background:url('../../public/img/header-background.png') left top no-repeat;
}
build
---css
------index.css //мой файл который подключает картинку
---img
------header-background.png
.header{
background:url('../../public/img/header-background.png') left top no-repeat;
}
.header {
background: url(img/header-background.png) left top no-repeat;
}
module.exports = {
...
rules:[
{
test:/\.(css|scss|sass)$/,
use:ExtractTextPlugin.extract({
use:[
{loader:'css-loader',options:{sourceMap:true}},
{loader:'resolve-url-loader',options:{sourceMap:true}},
{loader:'fast-sass-loader',options:{sourceMap:true}}
]
}),
},
],
...
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question