pokertk/.storybook/main.ts

36 lines
860 B
TypeScript
Raw Permalink Normal View History

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