forked from baron/baron-sso
네이버 웍스 연동기능 개선
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
import { createRequire } from "node:module";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { defineConfig, type UserConfig } from "vite";
|
||||
import { type UserConfig, defineConfig } from "vite";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const commonWorkspaceDir = path.resolve(
|
||||
path.dirname(fileURLToPath(import.meta.url)),
|
||||
"..",
|
||||
);
|
||||
const appWorkspaceDir = path.resolve(process.cwd());
|
||||
const reactPackageDir = path.dirname(require.resolve("react/package.json"));
|
||||
const reactDomPackageDir = path.dirname(
|
||||
require.resolve("react-dom/package.json"),
|
||||
@@ -23,6 +29,11 @@ export const commonViteConfig: UserConfig = {
|
||||
build: {
|
||||
emptyOutDir: true,
|
||||
},
|
||||
server: {
|
||||
fs: {
|
||||
allow: [appWorkspaceDir, commonWorkspaceDir, "/workspace/common"],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export function hostFromUrl(value: string | undefined) {
|
||||
@@ -37,7 +48,7 @@ export function hostFromUrl(value: string | undefined) {
|
||||
export function getAllowedHosts(
|
||||
defaultHosts: string[],
|
||||
envUrl?: string,
|
||||
envAllowedHosts?: string
|
||||
envAllowedHosts?: string,
|
||||
) {
|
||||
return Array.from(
|
||||
new Set(
|
||||
@@ -48,8 +59,8 @@ export function getAllowedHosts(
|
||||
.split(",")
|
||||
.map((host) => host.trim())
|
||||
.filter(Boolean),
|
||||
].filter((host): host is string => Boolean(host))
|
||||
)
|
||||
].filter((host): host is string => Boolean(host)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user