1 const DESIGN_SYSTEM_ICONS_SVG
= 'sprite-icons.svg|file-icons.svg';
3 module
.exports
= ({ inlineIcons
} = { inlineIcons
: false }) => [
6 * oneOf allows to take the first match instead of all matches, .e.g
10 * sprite-icons.svg -> [svg-inline-loader, url-loader, file-loader]
11 * img-1.svg -> [url loader, file loader]
12 * design-system-icon.svg -> file loader
16 * sprite-icons.svg -> svg-inline-loader
17 * img-1.svg -> url loader
18 * design-system-icon.svg -> file loader
22 test
: /\.source\.svg/,
23 // Special case for the email sprite icons which is injected into the MessageBodyIframe.tsx from getIframeHtml
25 loader
: 'svgo-loader',
27 plugins
: ['removeComments'],
31 test
: new RegExp(`${DESIGN_SYSTEM_ICONS_SVG}$`),
32 type
: inlineIcons
? 'asset/source' : 'asset/resource',
33 loader
: 'svgo-loader',
35 plugins
: ['removeComments'],
39 test
: /\.(bmp|png|jpg|jpeg|gif|svg)$/,
40 type
: 'asset/resource',
43 test
: /\.(woff|woff2|eot|ttf|otf|mp4|webm|pdf|csv)$/,
44 type
: 'asset/resource',