mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-10-31 18:28:44 +08:00 
			
		
		
		
	修复在vue3+vite3 模块中使用顶层await打包的时候报错
This commit is contained in:
		| @@ -12,6 +12,7 @@ import AutoImport from 'unplugin-auto-import/vite' | ||||
| import Components from 'unplugin-vue-components/vite' | ||||
| import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' | ||||
| import viteCompression from 'vite-plugin-compression' | ||||
| import topLevelAwait from 'vite-plugin-top-level-await' | ||||
| import vueSetupExtend from 'vite-plugin-vue-setup-extend' | ||||
| import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' | ||||
| import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' | ||||
| @@ -96,6 +97,12 @@ export function createVitePlugins() { | ||||
|       ext: '.gz', // 生成的压缩包后缀 | ||||
|       deleteOriginFile: false //压缩后是否删除源文件 | ||||
|     }), | ||||
|     ViteEjsPlugin() | ||||
|     ViteEjsPlugin(), | ||||
|     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}` | ||||
|     }) | ||||
|   ] | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 puhui999
					puhui999