Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ module.exports = {
}
],
webpackFinal: async config => {
// Remove default SVG processing from default config.
// @see https://github.com/storybookjs/storybook/issues/5708#issuecomment-515384927
config.module.rules = config.module.rules.map(data => {
if (/svg\|/.test(String(data.test))) {
data.test = /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|cur|ani)(\?.*)?$/;
}
return data;
});

// Push new rules
config.module.rules.push(
{
test: /\.twig$/,
Expand All @@ -31,6 +41,11 @@ module.exports = {
// Import Theo design tokens as JS objects
test: /\.ya?ml$/,
use: resolve(__dirname, './theo-loader.js')
},
{
// Optimize and process SVGs as React elements for use in documentation
test: /\.svg$/,
use: '@svgr/webpack'
}
);

Expand Down
3 changes: 3 additions & 0 deletions .svgo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
multipass: true
plugins:
- removeViewBox: false
Loading