diff --git a/packages/wepy-cli/src/util.js b/packages/wepy-cli/src/util.js index 765680edc..49766cb21 100644 --- a/packages/wepy-cli/src/util.js +++ b/packages/wepy-cli/src/util.js @@ -122,12 +122,13 @@ const utils = { let wpyExt = cache.getExt(); let src = ''; - if (com.indexOf(path.sep) !== -1||com.indexOf('@') === -1) { + if (com.indexOf(path.sep) !== -1 && com.indexOf('@') === -1) { if (this.isFile(com + wpyExt)) { src = com + wpyExt; } } else { let o = resolve.getMainFile(com); + if (o) { src = path.join(o.dir, o.file); } else {