未验证 提交 e3171355 编写于 作者: fxy060608's avatar fxy060608 提交者: GitHub

Merge pull request #3528 from xiaoxiangmoe/next

feat: add not supportGlobalUsingComponents logic
......@@ -64,12 +64,16 @@ export function findChangedJsonFiles(
newJson.usingComponents = {}
}
extend(newJson.usingComponents, jsonUsingComponentsCache.get(filename))
const usingComponents = newJson.usingComponents as Record<string, string>
// 格式化为相对路径,这样作为分包也可以直接运行
// app.json mp-baidu 在 win 不支持相对路径。所有平台改用绝对路径
if (filename !== 'app') {
let usingComponents = newJson.usingComponents as Record<string, string>
const globalUsingComponents = appJsonCache?.usingComponents ?? {}
// 如果小程序不支持 global 的 usingComponents
if (!supportGlobalUsingComponents) {
// TODO 从 appJsonCache 中读取 usingComponents 并 补充到 usingComponents 中
// 从 appJsonCache 中读取全局的 usingComponents 并补充到子组件 usingComponents 中
usingComponents = { ...globalUsingComponents, ...newJson.usingComponents}
}
Object.keys(usingComponents).forEach((name) => {
const componentFilename = usingComponents[name]
......@@ -80,6 +84,7 @@ export function findChangedJsonFiles(
)
}
})
newJson.usingComponents = usingComponents
}
const jsonStr = JSON.stringify(newJson, null, 2)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册