From a22dc3d22cfd8bf4d4e48a1a2f4c69adae6dadf6 Mon Sep 17 00:00:00 2001 From: gishmel Date: Tue, 4 Jul 2017 17:45:18 -0400 Subject: [PATCH] fix(importer): prevent duplicate dist --- lib/importer/services/resource-inclusion.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/importer/services/resource-inclusion.js b/lib/importer/services/resource-inclusion.js index dfbcfa9f3..b626ffe95 100644 --- a/lib/importer/services/resource-inclusion.js +++ b/lib/importer/services/resource-inclusion.js @@ -58,7 +58,14 @@ let ResourceInclusion = class { getResources(globExpr) { return this.glob(globExpr, { cwd: this.package.rootPath }) - .then(files => files.map(file => path.posix.join(file))); + .then(files => files.map(file => { + let directoryFromPath = this.package.path.substring(this.package.path.lastIndexOf('/') + 1); + let directoryFromFile = file.split('/').shift(); + if (directoryFromPath == directoryFromFile) { + file = file.substring(file.indexOf('/') + 1) + } + return path.posix.join(file); + })); } glob(globExpr, options) {