Selaa lähdekoodia

转换代码来兼容旧浏览器

zhuangyunsheng 1 vuosi sitten
vanhempi
commit
2717e79b8d
2 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 2 1
      package.json
  2. 3 0
      vite.config.js

+ 2 - 1
package.json

@@ -46,6 +46,7 @@
         "unplugin-icons": "^0.17.0",
         "unplugin-vue-components": "^0.25.2",
         "vite": "^4.4.9",
-        "vite-plugin-svg-icons": "^2.0.1"
+        "vite-plugin-svg-icons": "^2.0.1",
+        "vite-plugin-top-level-await": "^1.4.4"
     }
 }

+ 3 - 0
vite.config.js

@@ -1,3 +1,4 @@
+import topLevelAwait from 'vite-plugin-top-level-await';
 import { fileURLToPath, URL } from "node:url";
 import { defineConfig, loadEnv } from "vite";
 import vue from "@vitejs/plugin-vue";
@@ -35,6 +36,7 @@ export default defineConfig(({ mode }) => {
             }
         },
         build: {
+            target: "esnext",
             outDir: "dist",
             assetsDir: "static/assets",
             chunkSizeWarningLimit: 2000,
@@ -60,6 +62,7 @@ export default defineConfig(({ mode }) => {
             }
         },
         plugins: [
+            topLevelAwait(),
             vue({
                 template: {
                     compilerOptions: {