Created
May 15, 2024 16:03
-
-
Save amcdnl/485aaab71d41940e0958e1029104a522 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { webpack } = require('@storybook/csf-plugin'); | |
const withNextra = require('nextra')({ | |
theme: 'nextra-theme-docs', | |
themeConfig: './theme.config.tsx' | |
}); | |
module.exports = async () => { | |
const { ReactDocgenTypeScriptPlugin } = await import('@storybook/react-docgen-typescript-plugin'); | |
return withNextra({ | |
reactStrictMode: true, | |
eslint: { | |
ignoreDuringBuilds: true | |
}, | |
webpack: (config, _options) => { | |
return { | |
...config, | |
module: { | |
...(config.module ?? {}), | |
rules: [ | |
...(config.module?.rules ?? []), | |
{ | |
test: /\.(cjs|mjs|tsx?|jsx?)$/, | |
enforce: 'pre', | |
loader: require.resolve('@storybook/preset-react-webpack/dist/loaders/react-docgen-loader'), | |
options: { | |
debug: true, | |
}, | |
exclude: /(\.(stories|story)\.(js|jsx|ts|tsx))|(node_modules)/, | |
}, | |
], | |
}, | |
plugins: [ | |
...(config.plugins || []), | |
webpack({}), | |
new ReactDocgenTypeScriptPlugin({ | |
savePropValueAsString: true | |
}) | |
] | |
}; | |
} | |
}); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment