"Proper" top-level-await workaround

This commit is contained in:
Yeicor
2025-01-04 23:22:18 +01:00
parent b09d5a87fa
commit 8330060bd9
10 changed files with 125 additions and 221 deletions

View File

@@ -5,7 +5,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import {name, version} from './package.json'
import {execSync} from 'child_process'
import topLevelAwait from "vite-plugin-top-level-await";
// https://vitejs.dev/config/
export default defineConfig({
@@ -19,12 +18,6 @@ export default defineConfig({
}
}),
vueJsx(),
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}`
}),
],
resolve: {
alias: {