Browse Source

build: no legacy chunks

dongchengjie 1 year ago
parent
commit
0bf8807b50
1 changed files with 3 additions and 2 deletions
  1. 3 2
      vite.config.ts

+ 3 - 2
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"),