-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
main.js
78 lines (74 loc) · 2.34 KB
/
main.js
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import { mergeConfig } from "vite";
/** @type { import('@storybook/react-vite').StorybookConfig } */
export default process.env.STORYBOOK_VUE
? {
stories: ["../stories/vue/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-storysource"],
framework: {
name: "@storybook/vue3-vite",
options: {},
},
viteFinal: async (config) => {
const { default: vue } = await import("@vitejs/plugin-vue");
const { default: vueJsx } = await import("@vitejs/plugin-vue-jsx");
return mergeConfig(config, {
plugins: [vue(), vueJsx({ optimize: true })],
});
},
}
: process.env.STORYBOOK_SOLID
? {
stories: ["../stories/solid/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-storysource"],
framework: {
name: "storybook-solidjs-vite",
options: {},
},
}
: process.env.STORYBOOK_SVELTE
? {
stories: ["../stories/svelte/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-storysource"],
framework: {
name: "@storybook/svelte-vite",
options: {},
},
viteFinal: async (config) => {
const { svelte, vitePreprocess } = await import(
"@sveltejs/vite-plugin-svelte"
);
return mergeConfig(config, {
plugins: [svelte({ preprocess: vitePreprocess() })],
});
},
}
: {
stories: ["../stories/react/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-storysource"],
framework: {
name: "@storybook/react-vite",
options: {},
},
viteFinal: async (config) => {
const { default: react } = await import("@vitejs/plugin-react");
return mergeConfig(config, {
plugins: [react()],
});
},
...(process.env.STORYBOOK_DEPLOY && {
refs: {
vue: {
title: "Vue",
url: "/virtua/vue",
},
solid: {
title: "Solid",
url: "/virtua/solid",
},
svelte: {
title: "Svelte",
url: "/virtua/svelte",
},
},
}),
};