Answer the question
In order to leave comments, you need to log in
How to set path for files in sass-loader?
I have a config, everything is fine, but when processing a sass file, I get the /css prefix to all pictures and fonts . The problem is that they are stored in the directory below, i.e. I need to specify the path for all these files:
Now dist/css/img/Flowering_trees_Sakura_4.jpg
Should be: dist/img/Flowering_trees_Sakura_4.jpg
In css:
background-image: url(img/Flowering_trees_Sakura_427376.jpg);
background-image: url(../img/Flowering_trees_Sakura_427376.jpg);
{
test: /\.sass$/,
use: [
{
loader: 'file-loader',
options: {
name: 'css/[name].css'
// какая опция отвечает за путь к статическим файлам
}
},
'extract-loader',
'css-loader',
'postcss-loader',
'sass-loader'
]
},
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