Skip to content

Commit e577c07

Browse files
committed
fix(@angular/cli): GlobCopyWebpackPlugin should wait until assets are added before completing
1 parent 63eaaee commit e577c07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ 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[]) => Promise.all(relPaths.map((relPath: string) => addAsset(relPath))))
4747
.catch((err) => compilation.errors.push(err))
48-
.then(cb);
48+
.then(() => cb());
4949
});
5050
}
5151
}

0 commit comments

Comments
 (0)