From 0bf8807b50dcaa2579aa7afbaed60a0daef5c826 Mon Sep 17 00:00:00 2001 From: dongchengjie <37543964+dongchengjie@users.noreply.github.com> Date: Wed, 5 Jun 2024 09:04:08 +0800 Subject: [PATCH] build: no legacy chunks --- vite.config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index ae8e657..9e4f714 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,11 +12,12 @@ export default defineConfig({ svgr(), react(), legacy({ - targets: ["edge>=109", "safari>=13"], + renderLegacyChunks: false, + modernTargets: ["edge>=109", "safari>=13"], modernPolyfills: true, - polyfills: ["web.structured-clone"], additionalModernPolyfills: [ "core-js/modules/es.object.has-own.js", + "core-js/modules/web.structured-clone.js", path.resolve("./src/polyfills/matchMedia.js"), path.resolve("./src/polyfills/WeakRef.js"), path.resolve("./src/polyfills/RegExp.js"),