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 react from "@vitejs/plugin-react";
|
||||||
import { defineConfig, type UserConfig } from "vite";
|
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 = {
|
export const commonViteConfig: UserConfig = {
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
// Since we are using pnpm and common is our root, we might not need the strict aliases
|
resolve: {
|
||||||
// for react and lucide-react anymore, as pnpm will resolve them correctly from the root node_modules.
|
// 공용 패키지에서 hook를 쓰는 컴포넌트를 가져올 때 React가 중복 로드되면
|
||||||
// If we do need them, we can add them back per-app or dynamically resolve from common's __dirname.
|
// dispatcher가 분리되어 useState/useEffect가 런타임에 깨질 수 있습니다.
|
||||||
|
alias: {
|
||||||
|
react: reactPackageDir,
|
||||||
|
"react-dom": reactDomPackageDir,
|
||||||
|
},
|
||||||
|
dedupe: ["react", "react-dom"],
|
||||||
|
},
|
||||||
build: {
|
build: {
|
||||||
emptyOutDir: true,
|
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
@@ -62,6 +62,31 @@ find_available_port() {
|
|||||||
'
|
'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run_with_retry() {
|
||||||
|
local max_attempts="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
local attempt=1
|
||||||
|
local exit_code=0
|
||||||
|
while [ "$attempt" -le "$max_attempts" ]; do
|
||||||
|
if "$@"; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit_code=$?
|
||||||
|
if [ "$attempt" -ge "$max_attempts" ]; then
|
||||||
|
return "$exit_code"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> command failed (attempt $attempt/$max_attempts): $*"
|
||||||
|
echo "==> retrying in 10 seconds..."
|
||||||
|
sleep 10
|
||||||
|
attempt=$((attempt + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
return "$exit_code"
|
||||||
|
}
|
||||||
|
|
||||||
playwright_install_cmd=(npx playwright install)
|
playwright_install_cmd=(npx playwright install)
|
||||||
playwright_install_desc="npx playwright install"
|
playwright_install_desc="npx playwright install"
|
||||||
playwright_project_args=()
|
playwright_project_args=()
|
||||||
@@ -134,7 +159,8 @@ fi
|
|||||||
set +e
|
set +e
|
||||||
(
|
(
|
||||||
cd "$tmp_dir/adminfront"
|
cd "$tmp_dir/adminfront"
|
||||||
npm install -g pnpm && pnpm install -C ../common --no-frozen-lockfile
|
run_with_retry 3 npm install -g pnpm
|
||||||
|
run_with_retry 3 pnpm install -C ../common --no-frozen-lockfile
|
||||||
) 2>&1 | tee reports/adminfront-install.log
|
) 2>&1 | tee reports/adminfront-install.log
|
||||||
install_exit_code=${PIPESTATUS[0]}
|
install_exit_code=${PIPESTATUS[0]}
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
Reference in New Issue
Block a user