| import { dirname, join } from 'path'; |
| const customConfig = require('../../../webpack.config.js'); |
| |
| module.exports = { |
| addons: [ |
| getAbsolutePath('@storybook/addon-controls'), |
| '@mihkeleidast/storybook-addon-source', |
| getAbsolutePath('@storybook/addon-actions'), |
| getAbsolutePath('@storybook/addon-links'), |
| ], |
| |
| stories: ['../storybook/stories/**/*.stories.[tj]sx'], |
| |
| webpackFinal: config => ({ |
| ...config, |
| module: { |
| ...config.module, |
| rules: [ |
| ...customConfig.module.rules, |
| // Fix for Storybook 8 ESM issue with react-dom/test-utils |
| { |
| test: /\.m?js$/, |
| resolve: { |
| fullySpecified: false, |
| }, |
| }, |
| ], |
| }, |
| resolve: { |
| ...config.resolve, |
| ...customConfig.resolve, |
| alias: { |
| ...config.resolve?.alias, |
| ...customConfig.resolve?.alias, |
| }, |
| }, |
| }), |
| |
| typescript: { |
| reactDocgen: 'none', |
| }, |
| |
| framework: { |
| name: getAbsolutePath('@storybook/react-webpack5'), |
| options: {}, |
| }, |
| |
| docs: { |
| autodocs: false, |
| }, |
| }; |
| |
| function getAbsolutePath(value) { |
| return dirname(require.resolve(join(value, 'package.json'))); |
| } |