From 94ec559b37228e63d656cf8137feaf4e75447b6f Mon Sep 17 00:00:00 2001 From: mkrause Date: Fri, 15 Nov 2024 20:15:01 +0100 Subject: [PATCH] Fix storybook build. --- .storybook/main.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.storybook/main.ts b/.storybook/main.ts index 9087ab2..17ab501 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -3,6 +3,7 @@ |* the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import { type StorybookConfig } from '@storybook/react-vite'; +import { withoutVitePlugins } from '@storybook/builder-vite'; const config: StorybookConfig = { @@ -42,5 +43,12 @@ const config: StorybookConfig = { }, // https://storybook.js.org/docs/configure/images-and-assets#referencing-fonts-in-stories staticDirs: ['../src/assets'], + + async viteFinal(config) { + // Remove `vite-dts` plugin since it can cause some issues on storybook builds (and isn't necessary) + // https://github.com/qmhc/vite-plugin-dts/issues/275 + config.plugins = await withoutVitePlugins(config.plugins, ['vite:dts']); + return config; + }, }; export default config;