Skip to content

Commit

Permalink
feat(cli): config配置 alias选项 暂不支持转换usingComponents #1704 (#1859)
Browse files Browse the repository at this point in the history
在`transfromNativeComponents`函数调用了Util下的`isAliasPath`和`replaceAliasPath`解决
  • Loading branch information
lolipop99 authored and luckyadam committed Jan 9, 2019
1 parent 057ce87 commit e3a5548
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/taro-cli/src/weapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,13 @@ function transfromNativeComponents (configFile, componentConfig) {
const usingComponents = componentConfig.usingComponents
if (usingComponents && !Util.isEmptyObject(usingComponents)) {
Object.keys(usingComponents).map(async item => {
const componentPath = usingComponents[item]
let componentPath = usingComponents[item]

if (Util.isAliasPath(componentPath, pathAlias)) {
componentPath = Util.replaceAliasPath(configFile, componentPath, pathAlias)
usingComponents[item] = componentPath
}

if (/^plugin:\/\//.test(componentPath)) {
// 小程序 plugin
Util.printLog(Util.pocessTypeEnum.REFERENCE, '插件引用', `使用了插件 ${chalk.bold(componentPath)}`)
Expand Down

0 comments on commit e3a5548

Please sign in to comment.