-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathmain.ts
34 lines (32 loc) · 935 Bytes
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import type { StorybookConfig } from "@storybook/react-vite";
const EXCLUDED_VITE_PLUGIN = ["vite-plugin-mpa-router", "vite-plugin-service-worker"];
const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions"],
core: {
builder: "@storybook/builder-vite",
},
framework: {
name: "@storybook/react-vite",
options: {},
},
docs: {
autodocs: "tag",
},
async viteFinal(config) {
return {
...config,
appType: undefined,
base: "/storybook",
plugins: config.plugins?.filter((p) => {
if (p && "name" in p && typeof p.name === "string") {
const exclude = EXCLUDED_VITE_PLUGIN.includes(p.name);
return !exclude;
}
return true;
}),
test: undefined,
};
},
};
export default config;