Skip to content

Commit

Permalink
DISCUSS with Sam
Browse files Browse the repository at this point in the history
Without this, the webpack fails to build (something about a bad character in a `.png`)
  • Loading branch information
CamLamb committed Aug 18, 2023
1 parent e14d1f4 commit 9509f3a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
module: {
rules: [

// Use asset-modules to handle image assets, ignoring moj assets
// Copy all images and fonts to the output directory ignoring moj assets
{
test: /\.(png|jpe?g|gif|woff2?|svg|ico)$/i,
exclude: /@ministryofjustice\/frontend\/moj\/assets\/.*\.(png|jpe?g|gif|svg)$/i,
Expand All @@ -39,6 +39,15 @@ module.exports = {
},
},

// Copy MOJ assets into a custom output directory
{
test: /@ministryofjustice\/frontend\/moj\/assets\/.*\.(png|jpe?g|gif|svg)$/i,
type: 'asset/resource',
generator: {
filename: 'moj/[name][ext]',
},
},

// Extract compiled SCSS separately from JS
{
test: /\.(s[ac]ss|css)$/i,
Expand Down

0 comments on commit 9509f3a

Please sign in to comment.