1
0
forked from baron/baron-sso

refactor(frontend): centralize configurations and deduplicate dependencies in common workspace

- Centralized biome.json, tailwind.config.ts, and vite.config.ts into common/config.
- Updated sub-apps to inherit from shared base configurations.
- Deduplicated dependencies across apps using common workspace.
- Fixed TypeScript resolution issues by restoring necessary build dependencies.
- Removed obsolete package-lock.json files.
- Applied minor import fixes via Biome.
- Fixed react-router-dom v7 type errors.
This commit is contained in:
2026-05-15 10:28:07 +09:00
parent 4ca562ce0e
commit 8951de510e
30 changed files with 4565 additions and 16002 deletions

View File

@@ -1,53 +1,44 @@
import react from "@vitejs/plugin-react";
import path from "node:path";
import { defineConfig } from "vite";
import { defineConfig, mergeConfig } from "vite";
import { commonViteConfig, getAllowedHosts } from "../common/config/vite.base";
const buildOutDir =
process.env.ADMINFRONT_BUILD_OUT_DIR ?? "/tmp/baron-sso-adminfront-dist";
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"lucide-react": path.resolve(__dirname, "node_modules/lucide-react"),
react: path.resolve(__dirname, "node_modules/react"),
"react/jsx-dev-runtime": path.resolve(
__dirname,
"node_modules/react/jsx-dev-runtime.js",
),
"react/jsx-runtime": path.resolve(
__dirname,
"node_modules/react/jsx-runtime.js",
),
const allowedHosts = getAllowedHosts(
["sadmin.hmac.kr", "localhost", "172.16.10.176", "127.0.0.1"],
undefined,
undefined
);
export default defineConfig(
mergeConfig(commonViteConfig, {
envPrefix: ["VITE_", "USERFRONT_", "ORGFRONT_"],
cacheDir:
process.env.ADMINFRONT_VITE_CACHE_DIR ??
"/tmp/baron-sso-adminfront-vite-cache",
build: {
outDir: buildOutDir,
},
},
envPrefix: ["VITE_", "USERFRONT_", "ORGFRONT_"],
cacheDir:
process.env.ADMINFRONT_VITE_CACHE_DIR ??
"/tmp/baron-sso-adminfront-vite-cache",
build: {
outDir: buildOutDir,
emptyOutDir: true,
},
server: {
host: "127.0.0.1",
allowedHosts: ["sadmin.hmac.kr", "localhost", "172.16.10.176", "127.0.0.1"],
proxy: {
"/api": {
target: process.env.API_PROXY_TARGET || "http://localhost:3000",
changeOrigin: true,
server: {
host: "127.0.0.1",
allowedHosts,
proxy: {
"/api": {
target: process.env.API_PROXY_TARGET || "http://localhost:3000",
changeOrigin: true,
},
},
},
},
preview: {
host: "127.0.0.1",
port: 5173,
allowedHosts: ["sadmin.hmac.kr", "localhost", "172.16.10.176", "127.0.0.1"],
proxy: {
"/api": {
target: process.env.API_PROXY_TARGET || "http://localhost:3000",
changeOrigin: true,
preview: {
host: "127.0.0.1",
port: 5173,
allowedHosts,
proxy: {
"/api": {
target: process.env.API_PROXY_TARGET || "http://localhost:3000",
changeOrigin: true,
},
},
},
},
});
})
);