forked from baron/baron-sso
런트 CI 안정화를 위한 React 중복 해석 방지 및 설치 재시도 추가
This commit is contained in:
@@ -1,11 +1,25 @@
|
||||
import { createRequire } from "node:module";
|
||||
import path from "node:path";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { defineConfig, type UserConfig } from "vite";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const reactPackageDir = path.dirname(require.resolve("react/package.json"));
|
||||
const reactDomPackageDir = path.dirname(
|
||||
require.resolve("react-dom/package.json"),
|
||||
);
|
||||
|
||||
export const commonViteConfig: UserConfig = {
|
||||
plugins: [react()],
|
||||
// Since we are using pnpm and common is our root, we might not need the strict aliases
|
||||
// for react and lucide-react anymore, as pnpm will resolve them correctly from the root node_modules.
|
||||
// If we do need them, we can add them back per-app or dynamically resolve from common's __dirname.
|
||||
resolve: {
|
||||
// 공용 패키지에서 hook를 쓰는 컴포넌트를 가져올 때 React가 중복 로드되면
|
||||
// dispatcher가 분리되어 useState/useEffect가 런타임에 깨질 수 있습니다.
|
||||
alias: {
|
||||
react: reactPackageDir,
|
||||
"react-dom": reactDomPackageDir,
|
||||
},
|
||||
dedupe: ["react", "react-dom"],
|
||||
},
|
||||
build: {
|
||||
emptyOutDir: true,
|
||||
},
|
||||
|
||||
5508
common/package-lock.json
generated
Normal file
5508
common/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user