I have a pug mixin. Mixin is using to create block with whatever image name passed as argument.
mixin img({imageSrc: ""} = {})
.img(src="./img/" + imageSrc + ".jpg")
As a result I want webpack either place this image in dist/img/
or processed and replaced this path with it's base64 format.
Due to my need to save relative paths in sass and pug I use url-loader
. So my current configuration for pug and image looks like this:
module: {
rules: [{
test: /\.pug$/,
loader: 'pug-loader
}, {
test: /\.(jp(e*)g|png|svg)$/,
use: [{
loader: "url-loader",
options: {
outputPath: "images/"
}
}]
}]
}
Appreciate your help because I'm running out of ideas :c