Skip to content

Commit 795d91a

Browse files
authored
fix: fix images loading when using a relative path (Kocal#474)
* fix: fix images loading when using a relative path * fix(images): handle .jpeg too * chore(webpack): pass `emitFile` in options object
1 parent 8700217 commit 795d91a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

template/webpack.config.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,21 @@ const config = {
4545
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader?indentedSyntax'],
4646
},
4747
{
48-
test: /\.(png|jpg|gif|svg|ico)$/,
48+
test: /\.(png|jpg|jpeg|gif|svg|ico)$/,
4949
loader: 'file-loader',
5050
options: {
51-
name: '[name].[ext]?emitFile=false',
51+
name: '[name].[ext]',
52+
outputPath: '/images/',
53+
emitFile: false,
5254
},
5355
},
5456
{
5557
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
5658
loader: 'file-loader',
5759
options: {
58-
name: '[name].[ext]?emitFile=false',
59-
outputPath: '/fonts/'
60+
name: '[name].[ext]',
61+
outputPath: '/fonts/',
62+
emitFile: false,
6063
},
6164
},
6265
],

0 commit comments

Comments
 (0)