From c4f05233653c233b2265400616cf4a124dbd2a5b Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Wed, 24 Jan 2024 17:30:49 +0800 Subject: [PATCH] fix build error --- package-lock.json | 25 ++++++++++++++----------- package.json | 2 +- vite.config.ts | 4 +++- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 43f1f9c..d2bd41d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@codemirror/lang-python": "^6.1.3", "@vueuse/core": "^10.7.2", "axios": "^1.6.5", - "client-zip": "^2.4.4", + "client-zip": "^1.6.3", "codemirror": "^6.0.1", "copy-text-to-clipboard": "^3.2.0", "file-saver": "^2.0.5", @@ -2547,7 +2547,7 @@ }, "node_modules/@vitejs/plugin-legacy": { "version": "5.2.0", - "resolved": "https://registry.npmmirror.com/@vitejs/plugin-legacy/-/plugin-legacy-5.2.0.tgz", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-legacy/-/plugin-legacy-5.2.0.tgz", "integrity": "sha512-FGpxQCgyI8SHA/TkFH5vfBManyc6GYkCoYtmom924c7sKObnBE7q543RQuKK46duI4j31Nv1wg4GRNtCfsGpGQ==", "dev": true, "dependencies": { @@ -2562,6 +2562,9 @@ "engines": { "node": "^18.0.0 || >=20.0.0" }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, "peerDependencies": { "terser": "^5.4.0", "vite": "^5.0.0" @@ -2959,9 +2962,9 @@ } }, "node_modules/client-zip": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/client-zip/-/client-zip-2.4.4.tgz", - "integrity": "sha512-Ixk40BUI7VvNDxW7SCze20GbCuC+gjP4tGkXUpo6/W96bOf96HSed6cOQVeUOIe74SJAG/dIrBr7AtR4xBVnsA==" + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/client-zip/-/client-zip-1.6.3.tgz", + "integrity": "sha512-xn1boAEO+0qitRC7vr9i+4MlO0VqyXVsQpX/jKdbYhHGWRT7zCHHSV45mhfXPNnPinyhbC6dd8lOYQ1HDpL1pg==" }, "node_modules/codemirror": { "version": "6.0.1", @@ -3768,7 +3771,7 @@ }, "node_modules/terser": { "version": "5.27.0", - "resolved": "https://registry.npmmirror.com/terser/-/terser-5.27.0.tgz", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.0.tgz", "integrity": "sha512-bi1HRwVRskAjheeYl291n3JC4GgO/Ty4z1nVs5AAsmonJulGxpSektecnNedrwK9C7vpvVtcX3cw00VSLt7U2A==", "dev": true, "dependencies": { @@ -5723,7 +5726,7 @@ }, "@vitejs/plugin-legacy": { "version": "5.2.0", - "resolved": "https://registry.npmmirror.com/@vitejs/plugin-legacy/-/plugin-legacy-5.2.0.tgz", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-legacy/-/plugin-legacy-5.2.0.tgz", "integrity": "sha512-FGpxQCgyI8SHA/TkFH5vfBManyc6GYkCoYtmom924c7sKObnBE7q543RQuKK46duI4j31Nv1wg4GRNtCfsGpGQ==", "dev": true, "requires": { @@ -6054,9 +6057,9 @@ } }, "client-zip": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/client-zip/-/client-zip-2.4.4.tgz", - "integrity": "sha512-Ixk40BUI7VvNDxW7SCze20GbCuC+gjP4tGkXUpo6/W96bOf96HSed6cOQVeUOIe74SJAG/dIrBr7AtR4xBVnsA==" + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/client-zip/-/client-zip-1.6.3.tgz", + "integrity": "sha512-xn1boAEO+0qitRC7vr9i+4MlO0VqyXVsQpX/jKdbYhHGWRT7zCHHSV45mhfXPNnPinyhbC6dd8lOYQ1HDpL1pg==" }, "codemirror": { "version": "6.0.1", @@ -6690,7 +6693,7 @@ }, "terser": { "version": "5.27.0", - "resolved": "https://registry.npmmirror.com/terser/-/terser-5.27.0.tgz", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.0.tgz", "integrity": "sha512-bi1HRwVRskAjheeYl291n3JC4GgO/Ty4z1nVs5AAsmonJulGxpSektecnNedrwK9C7vpvVtcX3cw00VSLt7U2A==", "dev": true, "requires": { diff --git a/package.json b/package.json index 0b82218..1cb5416 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@codemirror/lang-python": "^6.1.3", "@vueuse/core": "^10.7.2", "axios": "^1.6.5", - "client-zip": "^2.4.4", + "client-zip": "^1.6.3", "codemirror": "^6.0.1", "copy-text-to-clipboard": "^3.2.0", "file-saver": "^2.0.5", diff --git a/vite.config.ts b/vite.config.ts index ca30b30..7c56bfc 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,11 +1,13 @@ import { defineConfig } from "vite" import vue from "@vitejs/plugin-vue" +import legacy from "@vitejs/plugin-legacy" export default defineConfig({ build: { rollupOptions: { output: { manualChunks: { + file: ["file-saver", "client-zip"], editor: [ "vue-codemirror", "codemirror", @@ -16,5 +18,5 @@ export default defineConfig({ }, }, }, - plugins: [vue()], + plugins: [vue(), legacy({ targets: ["chrome 66", "not IE 11"] })], })