Hello,
I tried to render image in scss file but cannot. Using require() in js is ok. But cannot load image url in css file
Here is my config
{
// Preprocess our own .scss files
test: /.scss$/,
exclude: /node_modules/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
my sccs script:
background: url("images/header/book.png") no-repeat;
Please use issue template, also you need url-loader or file-loader for assets.
I struggled with this for some time with my upgrade to webpack v4. Until I finally found the newer webpack-image-loader so I wrote up a quick post here with a code example:
https://medium.com/@albertomadueno/webpack-v4-config-d6cee480a071
also README here: https://github.com/tcoopman/image-webpack-loader
Most helpful comment
I struggled with this for some time with my upgrade to webpack v4. Until I finally found the newer webpack-image-loader so I wrote up a quick post here with a code example:
https://medium.com/@albertomadueno/webpack-v4-config-d6cee480a071
also README here: https://github.com/tcoopman/image-webpack-loader