Answer the question
In order to leave comments, you need to log in
Why is Wabpack not finding images?
Why can't webpack find the image when building? I have a Vue component:
<template lang="pug">
.form
img(src="images/success.png")
</template>
.form{
background: url('images/success.png');
}
Module not found: Error: Can't resolve './images/success.png'
module.exports = {
entry: './src/main.js',
output: {
path: path.resolve(__dirname, './server/public'),
publicPath: 'server/public',
filename: 'build.js'
},
module: {
rules: [
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
},
},
{
test: /\.sсss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'sass-loader']
})
}
]
},
plugins: [
new ExtractTextPlugin('style.css')
],
devtool: '#eval-source-map'
}
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