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) {