Skip to content
This repository was archived by the owner on Dec 22, 2024. It is now read-only.

Commit 2c62c2b

Browse files
committedDec 19, 2022
chore: migrate to vite 3
1 parent 3f4e8be commit 2c62c2b

File tree

3 files changed

+20702
-27011
lines changed

3 files changed

+20702
-27011
lines changed
 

‎.storybook/main.js

100644100755
+14-13
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,44 @@
11
const react = require("@vitejs/plugin-react");
2-
32
module.exports = {
43
stories: ["../stories/Start.stories.mdx", "../stories/**/*.stories.mdx", "../stories/**/*.stories.@(js|jsx|ts|tsx)"],
5-
staticDirs: [{ from: '../docs', to: '/docs'}],
4+
staticDirs: [{
5+
from: '../docs',
6+
to: '/docs'
7+
}],
68
addons: [{
79
name: '@storybook/addon-docs',
810
options: {
911
configureJSX: true,
1012
transcludeMarkdown: true
1113
}
1214
}, "@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-storysource"],
13-
core: {
14-
"builder": "@storybook/builder-vite"
15-
},
16-
1715
async viteFinal(config, {
1816
configType
1917
}) {
2018
config.plugins = config.plugins.filter(plugin => !(Array.isArray(plugin) && plugin[0]?.name.includes("vite:react")));
21-
2219
if (config.optimizeDeps) {
2320
config.optimizeDeps.include = [...(config.optimizeDeps.include || []), '@emotion/react/jsx-dev-runtime'];
2421
}
25-
2622
config.plugins.push(react({
2723
exclude: [/\.stories\.(t|j)sx?$/, /node_modules/],
2824
jsxImportSource: "@emotion/react",
2925
babel: {
3026
plugins: ["@emotion/babel-plugin"]
3127
}
3228
}));
33-
3429
if (configType === "PRODUCTION") {
35-
return { ...config,
30+
return {
31+
...config,
3632
base: './'
3733
};
3834
}
39-
4035
return config;
36+
},
37+
framework: {
38+
name: "@storybook/react-vite",
39+
options: {}
40+
},
41+
docs: {
42+
docsPage: "automatic"
4143
}
42-
43-
};
44+
};

0 commit comments

Comments
 (0)