Bladeren bron

vite-plugin-top-level-await

bzkf30 2 jaren geleden
bovenliggende
commit
247969878a
2 gewijzigde bestanden met toevoegingen van 554 en 346 verwijderingen
  1. 547 346
      pnpm-lock.yaml
  2. 7 0
      vite.config.ts

File diff suppressed because it is too large
+ 547 - 346
pnpm-lock.yaml


+ 7 - 0
vite.config.ts

@@ -8,6 +8,7 @@ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
 import Icons from 'unplugin-icons/vite'
 import IconsResolver from 'unplugin-icons/resolver'
 import ConditionalCompile from './plugins/vite-plugin-conditional-compile'
+import topLevelAwait from "vite-plugin-top-level-await";
 
 // https://vitejs.dev/config/
 export default defineConfig({
@@ -38,6 +39,12 @@ export default defineConfig({
   //   },
   // },
   plugins: [
+    topLevelAwait({
+      // The export name of top-level await promise for each chunk module
+      promiseExportName: "__tla",
+      // The function to generate import names of top-level await promise in each chunk module
+      promiseImportName: i => `__tla_${i}`
+    }),
     ConditionalCompile(),
     vue({
       reactivityTransform: true,