Skip to content

Commit 94ec559

Browse files
author
mkrause
committed
Fix storybook build.
1 parent f814ea9 commit 94ec559

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.storybook/main.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
|* the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
import { type StorybookConfig } from '@storybook/react-vite';
6+
import { withoutVitePlugins } from '@storybook/builder-vite';
67

78

89
const config: StorybookConfig = {
@@ -42,5 +43,12 @@ const config: StorybookConfig = {
4243
},
4344
// https://storybook.js.org/docs/configure/images-and-assets#referencing-fonts-in-stories
4445
staticDirs: ['../src/assets'],
46+
47+
async viteFinal(config) {
48+
// Remove `vite-dts` plugin since it can cause some issues on storybook builds (and isn't necessary)
49+
// https://github.com/qmhc/vite-plugin-dts/issues/275
50+
config.plugins = await withoutVitePlugins(config.plugins, ['vite:dts']);
51+
return config;
52+
},
4553
};
4654
export default config;

0 commit comments

Comments
 (0)