Skip to content

Commit

Permalink
Handle webpack .svg assets in line with .pngs
Browse files Browse the repository at this point in the history
govuk-frontend 5.7 replaces the existing 'govuk-crest.png' file with
'govuk-crest.svg'. This causes the build to fail due to the way webpack
handles .svg files. This commit fixes this by bringing handling of .svg
files in line with the approach currently used for .pngs.
  • Loading branch information
mpw5 committed Jan 6, 2025
1 parent bf73f45 commit 1944be7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ module.exports = {
]
},
{
test: /\.(png)$/i,
test: /\.(png|svg)$/i,
type: 'asset/resource'
},
{
test: /\.(woff|woff2|ttf)$/i,
type: 'asset/resource'
},
{
test: /\.(svg|ico)$/,
test: /\.(ico)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]'
Expand Down

0 comments on commit 1944be7

Please sign in to comment.