Skip to content

Commit

Permalink
added custom roles for svg
Browse files Browse the repository at this point in the history
  • Loading branch information
EnzoVezzaro committed May 9, 2022
1 parent c7cf5f1 commit 4a150f7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ module.exports = {
})
]

// Default rule for images /\.(svg|ico|jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|cur|ani|pdf)(\?.*)?$/
const fileLoaderRule = config.module.rules.find(
(rule) => rule.test && rule.test.test('.svg')
)
fileLoaderRule.exclude = /\.svg$/

config.module.rules.push({
test: /\.svg$/,
enforce: 'pre',
loader: require.resolve('@svgr/webpack')
})

return config
}
}

0 comments on commit 4a150f7

Please sign in to comment.