2020-05-11 20:28:18 +00:00
|
|
|
const path = require('path');
|
|
|
|
|
2020-01-19 15:31:13 +00:00
|
|
|
module.exports = {
|
2020-01-19 16:53:07 +00:00
|
|
|
stories: ['../client/**/*.stories.(jsx|mdx)'],
|
2020-01-19 21:05:16 +00:00
|
|
|
addons: [
|
|
|
|
'@storybook/addon-actions',
|
|
|
|
'@storybook/addon-docs',
|
|
|
|
'@storybook/addon-knobs',
|
|
|
|
'@storybook/addon-links',
|
|
|
|
'storybook-addon-theme-playground/dist/register'
|
|
|
|
],
|
2020-01-19 15:31:13 +00:00
|
|
|
webpackFinal: async config => {
|
|
|
|
// do mutation to the config
|
|
|
|
|
2020-05-11 20:28:18 +00:00
|
|
|
const rules = config.module.rules;
|
|
|
|
|
|
|
|
// modify storybook's file-loader rule to avoid conflicts with svgr
|
|
|
|
const fileLoaderRule = rules.find(rule => rule.test.test('.svg'));
|
|
|
|
fileLoaderRule.exclude = path.resolve(__dirname, '../client');
|
|
|
|
|
|
|
|
// use svgr for svg files
|
|
|
|
rules.push({
|
|
|
|
test: /\.svg$/,
|
|
|
|
use: ["@svgr/webpack"],
|
|
|
|
})
|
|
|
|
|
2020-01-19 15:31:13 +00:00
|
|
|
return config;
|
|
|
|
},
|
|
|
|
};
|