storybook/docs/snippets/common/storybook-vite-builder-aliasing.js.mdx
Chris Dillon 100450e950
fix: Syntax error in vite builder docs
Just a missing comma in the object.
2022-05-27 09:53:18 -07:00

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'],
},
});
},
};
```