From af5f67d459185c77d1edefec4fe06bc36dd06e6a Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Sun, 16 Jul 2023 16:32:22 +0800 Subject: [PATCH] feat: close #2376 add babel polyfill --- .babelrc | 14 ++++++++++++++ app/components/home.tsx | 2 +- next.config.mjs | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000000..53e4d9b2403 --- /dev/null +++ b/.babelrc @@ -0,0 +1,14 @@ +{ + "presets": [ + [ + "next/babel", + { + "preset-env": { + "targets": { + "browsers": ["> 0.25%, not dead"] + } + } + } + ] + ] +} diff --git a/app/components/home.tsx b/app/components/home.tsx index b3cec893ecf..68853e7438e 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -1,6 +1,6 @@ "use client"; -require("../polyfill"); +// require("../polyfill"); import { useState, useEffect } from "react"; diff --git a/next.config.mjs b/next.config.mjs index 01d34271799..c8f17de8c01 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -30,6 +30,9 @@ const nextConfig = { images: { unoptimized: mode === "export", }, + experimental: { + forceSwcTransforms: true, + }, }; if (mode !== "export") {