修复 Safari14兼容Top-level await特性

v2.4.4引入的问题
This commit is contained in:
景大侠
2025-07-07 13:57:35 +08:00
parent 73d7eb65b8
commit 7e4c6516c5
3 changed files with 110 additions and 18 deletions
+7
View File
@@ -9,6 +9,7 @@ import { VitePWA } from 'vite-plugin-pwa'
import VueI18n from '@intlify/unplugin-vue-i18n/vite'
import { resolve } from 'node:path'
import federation from '@originjs/vite-plugin-federation'
import topLevelAwait from 'vite-plugin-top-level-await'
// https://vitejs.dev/config/
export default defineConfig({
@@ -259,6 +260,12 @@ export default defineConfig({
'related_applications': [],
},
}),
topLevelAwait({
// The export name of top-level await promise for each chunk module
promiseExportName: '__mp_tla',
// The function to generate import names of top-level await promise in each chunk module
promiseImportName: i => `__mp_tla_${i}`,
}),
],
define: { 'process.env': {} },
resolve: {