From cb243115425584c4cb4f5fc0271ebdad8778dad6 Mon Sep 17 00:00:00 2001 From: anubra266 Date: Tue, 24 Dec 2024 06:05:26 -0800 Subject: [PATCH] chore: fix top level await --- site/tsconfig.app.json | 18 +++++++++++------- site/tsconfig.json | 12 ++++++++---- site/tsconfig.node.json | 18 +++++++++++------- site/vite.config.ts | 11 ++++++++--- 4 files changed, 38 insertions(+), 21 deletions(-) diff --git a/site/tsconfig.app.json b/site/tsconfig.app.json index 358ca9b..0d01e74 100644 --- a/site/tsconfig.app.json +++ b/site/tsconfig.app.json @@ -1,12 +1,15 @@ { "compilerOptions": { "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", - "target": "ES2020", "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "module": "ESNext", + "target": "esnext", + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "module": "esnext", "skipLibCheck": true, - /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, @@ -14,7 +17,6 @@ "moduleDetection": "force", "noEmit": true, "jsx": "react-jsx", - /* Linting */ "strict": true, "noUnusedLocals": true, @@ -22,5 +24,7 @@ "noFallthroughCasesInSwitch": true, "noUncheckedSideEffectImports": true }, - "include": ["src"] -} + "include": [ + "src" + ] +} \ No newline at end of file diff --git a/site/tsconfig.json b/site/tsconfig.json index 1ffef60..fcf5db7 100644 --- a/site/tsconfig.json +++ b/site/tsconfig.json @@ -1,7 +1,11 @@ { "files": [], "references": [ - { "path": "./tsconfig.app.json" }, - { "path": "./tsconfig.node.json" } - ] -} + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.node.json" + } + ], +} \ No newline at end of file diff --git a/site/tsconfig.node.json b/site/tsconfig.node.json index db0becc..ca214e9 100644 --- a/site/tsconfig.node.json +++ b/site/tsconfig.node.json @@ -1,18 +1,20 @@ { "compilerOptions": { "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", - "target": "ES2022", - "lib": ["ES2023"], - "module": "ESNext", + "target": "esnext", + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "module": "esnext", "skipLibCheck": true, - /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, "isolatedModules": true, "moduleDetection": "force", "noEmit": true, - /* Linting */ "strict": true, "noUnusedLocals": true, @@ -20,5 +22,7 @@ "noFallthroughCasesInSwitch": true, "noUncheckedSideEffectImports": true }, - "include": ["vite.config.ts"] -} + "include": [ + "vite.config.ts" + ] +} \ No newline at end of file diff --git a/site/vite.config.ts b/site/vite.config.ts index 8b0f57b..caa0a25 100644 --- a/site/vite.config.ts +++ b/site/vite.config.ts @@ -1,7 +1,12 @@ -import { defineConfig } from 'vite' -import react from '@vitejs/plugin-react' +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; // https://vite.dev/config/ export default defineConfig({ plugins: [react()], -}) + esbuild: { + supported: { + "top-level-await": true, //browsers can handle top-level-await features + }, + }, +});