Skip to content

Commit

Permalink
fix(importer): prevent duplicate dist
Browse files Browse the repository at this point in the history
  • Loading branch information
gishmel committed Jul 8, 2017
1 parent cdb2eb3 commit a22dc3d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/importer/services/resource-inclusion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a22dc3d

Please sign in to comment.