mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 02:11:07 +08:00
25 lines
693 B
Plaintext
25 lines
693 B
Plaintext
```js
|
|
// .storybook/main.js|cjs|ts
|
|
|
|
const { mergeConfig } = require('vite');
|
|
|
|
module.exports = {
|
|
stories: ['../stories/**/*.stories.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'],
|
|
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
|
|
core: {
|
|
builder: '@storybook/builder-vite',
|
|
},
|
|
async viteFinal(config) {
|
|
// Merge custom configuration into the default config
|
|
return mergeConfig(config, {
|
|
// Use the same "resolve" configuration as your app
|
|
resolve: (await import('../vite.config.js')).default.resolve,
|
|
// Add dependencies to pre-optimization
|
|
optimizeDeps: {
|
|
include: ['storybook-dark-mode'],
|
|
},
|
|
});
|
|
},
|
|
};
|
|
```
|