Skip to content

Commit

Permalink
fix(@angular/cli): GlobCopyWebpackPlugin should wait until assets are…
Browse files Browse the repository at this point in the history
… added before completing
  • Loading branch information
alxhub authored and hansl committed Feb 9, 2017
1 parent c617c21 commit 849155c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/@angular/cli/plugins/glob-copy-webpack-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ export class GlobCopyWebpackPlugin {
// flatten results
.then(globResults => [].concat.apply([], globResults))
// add each file to compilation assets
.then(relPaths => relPaths.forEach((relPath: string) => addAsset(relPath)))
.then((relPaths: string[]) =>
Promise.all(relPaths.map((relPath: string) => addAsset(relPath))))
.catch((err) => compilation.errors.push(err))
.then(cb);
.then(() => cb());
});
}
}

0 comments on commit 849155c

Please sign in to comment.