I'm trying to build simple website using webpack, all setting are fine, except generated background image url in css....
My folder structure:
dist/
css/
style.css
images/
img1.png
js/
index.html
src/
scss/
style.scss
images/
set1/
img1.png
js/
index.html
style.scss
.container{
width: 100%;
height: 600px;
background: url('../images/set/car.png') no-repeat;
}
style.css
.container{
width: 100%;
height: 600px;
background: url('../images/car.png') no-repeat;
}
Problem is images/set folder in src not created in dist folder
my webpack.config.js
module.exports = {
entry: {
plugin: path.resolve(__dirname, 'src/js/plugin.js'),
main: path.resolve(__dirname, 'src/js/index.js'),
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'js/[name].bundle.js'
},
module:{
rules: [
{
test: /\.(jpe?g|png|gif|svg)$/i,
loader: "file-loader?name=[name].[ext]"
}
]
}
}
Please solve this issue, i referred many article but i did not get any solution