From e606f4f03062d16e55571b691768142865c49ba5 Mon Sep 17 00:00:00 2001 From: MatrixSeven Date: Fri, 8 Aug 2025 16:31:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF,=E7=A7=BB=E9=99=A4=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chuan-next/next.config.js | 7 +++++ chuan-next/src/components/ui/toaster.tsx | 35 ------------------------ 2 files changed, 7 insertions(+), 35 deletions(-) delete mode 100644 chuan-next/src/components/ui/toaster.tsx diff --git a/chuan-next/next.config.js b/chuan-next/next.config.js index d599647..e682619 100644 --- a/chuan-next/next.config.js +++ b/chuan-next/next.config.js @@ -1,5 +1,12 @@ /** @type {import('next').NextConfig} */ const nextConfig = { + // 编译器配置 - 在生产环境中去掉 console.log + compiler: { + removeConsole: process.env.NODE_ENV === 'production' ? { + exclude: ['error', 'warn', 'info'], // 保留 console.error, console.warn, console.info + } : false, + }, + // 环境变量配置 env: { GO_BACKEND_URL: process.env.GO_BACKEND_URL, diff --git a/chuan-next/src/components/ui/toaster.tsx b/chuan-next/src/components/ui/toaster.tsx deleted file mode 100644 index f6adb95..0000000 --- a/chuan-next/src/components/ui/toaster.tsx +++ /dev/null @@ -1,35 +0,0 @@ -"use client" - -import { - Toast, - ToastClose, - ToastDescription, - ToastProvider, - ToastTitle, - ToastViewport, -} from "@/components/ui/toast" -import { useToast } from "@/hooks/use-toast" - -export function Toaster() { - const { toasts } = useToast() - - return ( - - {toasts.map(function ({ id, title, description, action, ...props }) { - return ( - -
- {title && {title}} - {description && ( - {description} - )} -
- {action} - -
- ) - })} - -
- ) -}