Browse Source

feat: close #2376 add babel polyfill

Yidadaa 1 year ago
parent
commit
af5f67d459
3 changed files with 18 additions and 1 deletions
  1. 14 0
      .babelrc
  2. 1 1
      app/components/home.tsx
  3. 3 0
      next.config.mjs

+ 14 - 0
.babelrc

@@ -0,0 +1,14 @@
+{
+  "presets": [
+    [
+      "next/babel",
+      {
+        "preset-env": {
+          "targets": {
+            "browsers": ["> 0.25%, not dead"]
+          }
+        }
+      }
+    ]
+  ]
+}

+ 1 - 1
app/components/home.tsx

@@ -1,6 +1,6 @@
 "use client";
 
-require("../polyfill");
+// require("../polyfill");
 
 import { useState, useEffect } from "react";
 

+ 3 - 0
next.config.mjs

@@ -30,6 +30,9 @@ const nextConfig = {
   images: {
     unoptimized: mode === "export",
   },
+  experimental: {
+    forceSwcTransforms: true,
+  },
 };
 
 if (mode !== "export") {