From 21e152cb747eb5d118136466d8231e631ac94fe7 Mon Sep 17 00:00:00 2001 From: xxx Date: Wed, 20 Sep 2023 10:23:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E5=AE=89=E5=8D=93?= =?UTF-8?q?=E9=92=89=E9=92=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 ++ vite.config.ts | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c06578c..1678a54 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,11 @@ "devDependencies": { "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", + "@vitejs/plugin-legacy": "^4.1.1", "@vitejs/plugin-react-swc": "^3.0.0", "rollup-plugin-gzip": "^3.1.0", "sass": "^1.59.3", + "terser": "^5.19.4", "typescript": "^4.9.3", "vite": "^4.2.0" } diff --git a/vite.config.ts b/vite.config.ts index 834024b..e8202c7 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,13 +1,22 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react-swc"; import gzipPlugin from "rollup-plugin-gzip"; +import legacy from "@vitejs/plugin-legacy"; // https://vitejs.dev/config/ export default defineConfig({ server: { host: "0.0.0.0", }, - plugins: [react()], + plugins: [ + react(), + legacy({ + targets: ["chrome 52"], + additionalLegacyPolyfills: ["regenerator-runtime/runtime"], + renderLegacyChunks: true, + modernPolyfills: true, + }), + ], build: { rollupOptions: { plugins: [gzipPlugin()], From 0f811618b73824ff3e18664fad0de037c9106074 Mon Sep 17 00:00:00 2001 From: unknown <18119604035@163.com> Date: Fri, 22 Sep 2023 15:29:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?iconfont=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.scss | 2 -- src/main.tsx | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.scss b/src/main.scss index 6f3a8fa..b2f03c4 100644 --- a/src/main.scss +++ b/src/main.scss @@ -1,5 +1,3 @@ -@import "./assets/iconfont/iconfont.css"; - body { margin: 0; } diff --git a/src/main.tsx b/src/main.tsx index b0fa212..c390661 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -2,6 +2,7 @@ import ReactDOM from "react-dom/client"; import { Provider } from "react-redux"; import store from "./store"; import { BrowserRouter } from "react-router-dom"; +import "./assets/iconfont/iconfont.css"; import "./main.scss"; import App from "./App"; import AutoScorllTop from "./AutoTop";