import { StorybookConfig } from '@storybook/react-webpack5'; const path = require('path'); const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); const config: StorybookConfig = { stories: ['../src/**/*.stories.tsx'], addons: [ '@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions', '@storybook/preset-create-react-app', ], framework: { name: '@storybook/react-webpack5', options: {}, }, webpackFinal: async config => { if (!config.resolve) { config.resolve = {}; } config.resolve.plugins = config.resolve.plugins || []; config.resolve.plugins.push( new TsconfigPathsPlugin({ configFile: path.resolve(__dirname, '../tsconfig.json'), }), ); return config; }, docs: { autodocs: true, }, }; export default config;