Skip to content

Commit

Permalink
fix(cli): 修正快应用编译时组件路径计算
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Aug 1, 2019
1 parent 2fc083b commit b8a9582
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/taro-cli/src/mini/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export async function buildSingleComponent (
const importTaroSelfComponents = getImportTaroSelfComponents(outputComponentJSPath, res.taroSelfComponents)
const importCustomComponents = new Set(realComponentsPathList.map(item => {
return {
path: path.relative(path.dirname(component), item.path as string).replace(path.extname(item.path as string), ''),
path: promoteRelativePath(path.relative(component, item.path as string)).replace(path.extname(item.path as string), ''),
name: item.name as string
}
}))
Expand All @@ -262,7 +262,7 @@ export async function buildSingleComponent (
template: componentWXMLContent
})
fs.writeFileSync(outputComponentWXMLPath, uxTxt)
printLog(processTypeEnum.GENERATE, '组件文件', `${outputDirName}/${componentObj.name}${outputFilesTypes.TEMPL}`)
printLog(processTypeEnum.GENERATE, '组件文件', `${outputComponentShowPath}${outputFilesTypes.TEMPL}`)
}

const dependencyTree = getDependencyTree()
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-cli/src/mini/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export async function buildSinglePage (page: string) {
const importTaroSelfComponents = getImportTaroSelfComponents(outputPageJSPath, res.taroSelfComponents)
const importCustomComponents = new Set(realComponentsPathList.map(item => {
return {
path: path.relative(path.dirname(pageJs), item.path as string).replace(path.extname(item.path as string), ''),
path: promoteRelativePath(path.relative(pageJs, item.path as string)).replace(path.extname(item.path as string), ''),
name: item.name as string
}
}))
Expand Down

0 comments on commit b8a9582

Please sign in to comment.