Skip to content

Commit 849155c

Browse files
alxhubhansl
authored andcommitted
fix(@angular/cli): GlobCopyWebpackPlugin should wait until assets are added before completing
1 parent c617c21 commit 849155c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/@angular/cli/plugins/glob-copy-webpack-plugin.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ export class GlobCopyWebpackPlugin {
4343
// flatten results
4444
.then(globResults => [].concat.apply([], globResults))
4545
// add each file to compilation assets
46-
.then(relPaths => relPaths.forEach((relPath: string) => addAsset(relPath)))
46+
.then((relPaths: string[]) =>
47+
Promise.all(relPaths.map((relPath: string) => addAsset(relPath))))
4748
.catch((err) => compilation.errors.push(err))
48-
.then(cb);
49+
.then(() => cb());
4950
});
5051
}
5152
}

0 commit comments

Comments
 (0)