From 9f5abd8ffb4203c18e942da32a4387376a855730 Mon Sep 17 00:00:00 2001 From: York Date: Thu, 20 Feb 2025 14:21:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 27 +-------------------------- vite.config.ts | 11 ++++++++--- 2 files changed, 9 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 5dc5358..6da91c6 100644 --- a/package.json +++ b/package.json @@ -5,32 +5,7 @@ "type": "module", "scripts": { "dev": "vite", - "build": "vite build", + "build": "vite build && cp dist/index.html dist/404.html", "preview": "vite preview" - }, - "dependencies": { - "@emotion/react": "^11.14.0", - "@emotion/styled": "^11.14.0", - "@mui/icons-material": "^6.4.5", - "@mui/material": "^6.4.5", - "@types/uuid": "^10.0.0", - "chart.js": "^4.4.7", - "react": "^19.0.0", - "react-chartjs-2": "^5.3.0", - "react-dom": "^19.0.0", - "typescript": "~5.7.2", - "uuid": "^11.0.5" - }, - "devDependencies": { - "@eslint/js": "^9.19.0", - "@types/react": "^19.0.8", - "@types/react-dom": "^19.0.3", - "@vitejs/plugin-react": "^4.3.4", - "eslint": "^9.19.0", - "eslint-plugin-react-hooks": "^5.0.0", - "eslint-plugin-react-refresh": "^0.4.18", - "globals": "^15.14.0", - "typescript-eslint": "^8.22.0", - "vite": "^6.1.0" } } diff --git a/vite.config.ts b/vite.config.ts index a77d620..3095b7f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,11 +3,16 @@ import react from '@vitejs/plugin-react' export default defineConfig({ plugins: [react()], - base: './', // 修改这里 + base: '', // 修改这里 build: { outDir: 'dist', assetsDir: 'assets', - sourcemap: true, // 添加这行以便调试 - minify: true + sourcemap: false, + minify: true, + rollupOptions: { + output: { + manualChunks: undefined + } + } } })