From dede578567264b59b271ed84e57b1817eb993e6d Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Wed, 14 Nov 2018 10:21:48 +0800 Subject: [PATCH] support monorepo --- lib/mp-compiler/util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mp-compiler/util.js b/lib/mp-compiler/util.js index 80686d0..eec581f 100644 --- a/lib/mp-compiler/util.js +++ b/lib/mp-compiler/util.js @@ -16,7 +16,9 @@ function getFileInfo (resourcePath) { var hash = require('hash-sum') const cache = Object.create(null) function getCompNameAndSrc (context, file) { - const filePath = `/${resolveSrc(context, file)}.wxml` + let filePath = `/${resolveSrc(context, file)}.wxml` + // 支持monorepo + filePath = filePath.replace('/..', '') if (!cache[file]) { cache[file] = hash(file) }