fix(runtime-build) 修复:运行时多入口打包会抽取公共依赖,导致加载报错 (#191)

This commit is contained in:
ajaxzheng 2023-05-05 18:15:21 +08:00 committed by GitHub
parent 3e4b201e76
commit 4d448833e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -140,7 +140,11 @@ export async function buildRuntime({
// 要构建的vue框架版本
for (const vueVersion of vueVersions) {
const message = `TINY for vue${vueVersion}: runtime`
await batchBuildAll({ vueVersion, tasks, message, emptyOutDir, npmScope: scope, min })
// 这里注意不能使用多入口打包rollup多入口打包会抽取公共依赖再由inlineChunksPlugin插件处理导致组件库运行时加载失败
for (let i = 0; i < tasks.length; i++) {
await batchBuildAll({ vueVersion, tasks: [tasks[i]], message, emptyOutDir, npmScope: scope, min })
}
// 确保只运行一次
emptyOutDir = false
}