Skip to content

Commit 262a247

Browse files
authored
Update the webpack config to fully ignore images
Previously, while images would be loaded via the null-loader, if Webpack couldn't find the images it would still crash. This meant you had to use the real path to the images from your html file, like: `<img src="../../assets/img/test.png>`, which is not really going to work once deployed. Instead I've updated the html-loader to not even try to load images. By default it tries to require any images it comes across, but by setting `attrs=false` it will no longer do that.
1 parent e36d6b5 commit 262a247

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test-config/webpack.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020
},
2121
{
2222
test: /\.html$/,
23-
loader: 'html-loader'
23+
loader: 'html-loader?attrs=false'
2424
},
2525
{
2626
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,

0 commit comments

Comments
 (0)