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} - -
- ) - })} - -
- ) -}