Rename .storybook/main.js to main.ts and add type to make it works
This commit is contained in:
parent
3eb8eb836e
commit
05d31c55a9
@ -1,6 +1,9 @@
|
|||||||
|
import { StorybookConfig } from '@storybook/react-webpack5';
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
||||||
module.exports = {
|
|
||||||
|
const config: StorybookConfig = {
|
||||||
stories: ['../src/**/*.stories.tsx'],
|
stories: ['../src/**/*.stories.tsx'],
|
||||||
addons: [
|
addons: [
|
||||||
'@storybook/addon-links',
|
'@storybook/addon-links',
|
||||||
@ -13,6 +16,9 @@ module.exports = {
|
|||||||
options: {},
|
options: {},
|
||||||
},
|
},
|
||||||
webpackFinal: async config => {
|
webpackFinal: async config => {
|
||||||
|
if (!config.resolve) {
|
||||||
|
config.resolve = {};
|
||||||
|
}
|
||||||
config.resolve.plugins = config.resolve.plugins || [];
|
config.resolve.plugins = config.resolve.plugins || [];
|
||||||
config.resolve.plugins.push(
|
config.resolve.plugins.push(
|
||||||
new TsconfigPathsPlugin({
|
new TsconfigPathsPlugin({
|
||||||
@ -25,3 +31,5 @@ module.exports = {
|
|||||||
autodocs: true,
|
autodocs: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default config;
|
Loading…
x
Reference in New Issue
Block a user