p5.js-web-editor/.storybook/main.js

30 lines
743 B
JavaScript
Raw Permalink Normal View History

2020-05-11 22:28:18 +02:00
const path = require('path');
2020-01-19 16:31:13 +01:00
module.exports = {
stories: ['../client/**/*.stories.(jsx|mdx)'],
2020-01-19 22:05:16 +01:00
addons: [
'@storybook/addon-actions',
'@storybook/addon-docs',
'@storybook/addon-knobs',
'@storybook/addon-links',
'storybook-addon-theme-playground/dist/register'
],
2020-01-19 16:31:13 +01:00
webpackFinal: async config => {
// do mutation to the config
2020-05-11 22:28:18 +02: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 16:31:13 +01:00
return config;
},
};