mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
26 lines
819 B
Plaintext
26 lines
819 B
Plaintext
```js
|
|
// .storybook/main.js
|
|
|
|
export default {
|
|
// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)
|
|
framework: '@storybook/your-framework',
|
|
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
viteFinal: async (config) => {
|
|
if (config.resolve) {
|
|
config.resolve.alias = {
|
|
...config.resolve?.alias,
|
|
// 👇 External module
|
|
lodash: require.resolve('./lodash.mock'),
|
|
// 👇 Internal modules
|
|
'@/api': path.resolve(__dirname, './api.mock.ts'),
|
|
'@/app/actions': path.resolve(__dirname, './app/actions.mock.ts'),
|
|
'@/lib/session': path.resolve(__dirname, './lib/session.mock.ts'),
|
|
'@/lib/db': path.resolve(__dirname, './lib/db.mock.ts'),
|
|
};
|
|
}
|
|
|
|
return config;
|
|
},
|
|
};
|
|
```
|