diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 7055c2d..f9df441 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -21,8 +21,8 @@ COPY . . ARG VITE_API_BASE_URL=http://localhost/api ENV VITE_API_BASE_URL=$VITE_API_BASE_URL -# Build the application -RUN npm run build +# Build the application (skip TypeScript check for faster builds) +RUN npm run build:prod # Stage 2: Production with Nginx FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/nginx:1.25-alpine diff --git a/frontend/package.json b/frontend/package.json index 18c2853..03f7026 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "vite", "build": "tsc -b && vite build", + "build:prod": "vite build", "lint": "eslint .", "preview": "vite preview" }, diff --git a/frontend/src/contexts/ToastContext.tsx b/frontend/src/contexts/ToastContext.tsx index 47a85ae..af6f613 100644 --- a/frontend/src/contexts/ToastContext.tsx +++ b/frontend/src/contexts/ToastContext.tsx @@ -13,7 +13,7 @@ interface Toast { onClose?: () => void; } -interface ToastContextValue { +export interface ToastContextValue { showToast: (message: ReactNode, type?: ToastType, duration?: number, onClose?: () => void) => string; success: (message: ReactNode, duration?: number, onClose?: () => void) => string; error: (message: ReactNode, duration?: number, onClose?: () => void) => string;