Skip to content

Commit f44d7c6

Browse files
committed
chore: 스토리북을 재시작하면 Vite를 사용하여 더 빠르게 실행
1 parent c961716 commit f44d7c6

File tree

2 files changed

+27
-22
lines changed

2 files changed

+27
-22
lines changed

.storybook/main.ts

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import type { StorybookConfig as BaseStorybookConfig } from "@storybook/nextjs";
2+
import { mergeConfig } from "vite";
3+
import path from "path";
24

5+
// StorybookConfig 인터페이스 확장
36
interface StorybookConfig extends BaseStorybookConfig {
47
viteFinal?: (config: any) => Promise<any>;
58
}
@@ -18,33 +21,35 @@ const config: StorybookConfig = {
1821
options: {},
1922
},
2023
staticDirs: ["../public"],
24+
core: {
25+
builder: "@storybook/builder-vite", // Vite 빌더 사용
26+
},
2127
async viteFinal(config) {
22-
config.css = {
23-
postcss: {
24-
plugins: [require("tailwindcss"), require("autoprefixer")],
28+
return mergeConfig(config, {
29+
resolve: {
30+
alias: {
31+
"@": path.resolve(__dirname, "../src"),
32+
"react-beautiful-dnd": path.resolve(__dirname, "../node_modules/react-beautiful-dnd"),
33+
},
34+
},
35+
css: {
36+
postcss: {
37+
plugins: [require("tailwindcss"), require("autoprefixer")],
38+
},
39+
},
40+
optimizeDeps: {
41+
include: ["react-beautiful-dnd"],
42+
},
43+
build: {
44+
commonjsOptions: {
45+
include: [/react-beautiful-dnd/, /node_modules/],
46+
},
2547
},
26-
};
27-
return config;
48+
});
2849
},
2950
docs: {
3051
autodocs: "tag",
3152
},
32-
webpackFinal: async (config) => {
33-
// webpack 설정 수정
34-
config.resolve = {
35-
...config.resolve,
36-
fallback: {
37-
...config.resolve?.fallback,
38-
fs: false,
39-
path: false,
40-
},
41-
alias: {
42-
...config.resolve?.alias,
43-
"react-beautiful-dnd": require.resolve("react-beautiful-dnd"),
44-
},
45-
};
46-
return config;
47-
},
4853
};
4954

5055
export default config;

src/app/stories/design-system/components/input/image/ImageInput.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ export const Upload_Image: Story = {
2525
console.log("Images changed:", images);
2626
},
2727
},
28-
};
28+
};

0 commit comments

Comments
 (0)