提交 39f6c623 编写于 作者: fxy060608's avatar fxy060608

fix(mp): usingComponents support plugin:// (#3035)

上级 e17cbc78
...@@ -42,13 +42,16 @@ export function findChangedJsonFiles() { ...@@ -42,13 +42,16 @@ export function findChangedJsonFiles() {
newJson.usingComponents = {} newJson.usingComponents = {}
} }
extend(newJson.usingComponents, jsonUsingComponentsCache.get(filename)) extend(newJson.usingComponents, jsonUsingComponentsCache.get(filename))
const usingComponents = newJson.usingComponents const usingComponents = newJson.usingComponents as Record<string, string>
// 格式化为相对路径,这样作为分包也可以直接运行 // 格式化为相对路径,这样作为分包也可以直接运行
Object.keys(usingComponents).forEach((name) => { Object.keys(usingComponents).forEach((name) => {
usingComponents[name] = relativeFile( const componentFilename = usingComponents[name]
filename, if (componentFilename.startsWith('/')) {
usingComponents[name].slice(1) usingComponents[name] = relativeFile(
) filename,
componentFilename.slice(1)
)
}
}) })
const jsonStr = JSON.stringify(newJson, null, 2) const jsonStr = JSON.stringify(newJson, null, 2)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册