Skip to content

Commit

Permalink
fix: add polyfill for safari
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Oct 31, 2024
1 parent a0c6b82 commit 43476bd
Show file tree
Hide file tree
Showing 3 changed files with 1,503 additions and 244 deletions.
2 changes: 2 additions & 0 deletions frontend/nyanpasu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@types/validator": "13.12.2",
"@vitejs/plugin-legacy": "^5.4.3",
"@vitejs/plugin-react": "4.3.3",
"@vitejs/plugin-react-swc": "3.7.1",
"change-case": "5.4.4",
"clsx": "2.1.1",
"core-js": "^3.39.0",
"filesize": "10.1.6",
"meta-json-schema": "1.18.9",
"monaco-yaml": "5.2.2",
Expand Down
11 changes: 11 additions & 0 deletions frontend/nyanpasu/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import svgr from "vite-plugin-svgr";
import tsconfigPaths from "vite-tsconfig-paths";
// import react from "@vitejs/plugin-react";
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
import legacy from "@vitejs/plugin-legacy";
import react from "@vitejs/plugin-react-swc";

const devtools = () => {
Expand Down Expand Up @@ -48,6 +49,16 @@ export default defineConfig(({ command }) => {
},
plugins: [
tsconfigPaths(),
legacy({
renderLegacyChunks: false,
modernTargets: ["edge>=109", "safari>=13"],
modernPolyfills: true,
additionalModernPolyfills: [
"core-js/modules/es.object.has-own.js",
"core-js/modules/web.structured-clone.js",
"core-js/modules/es.array.at.js",
],
}),
TanStackRouterVite(),
svgr(),
react({
Expand Down
Loading

0 comments on commit 43476bd

Please sign in to comment.