Skip to content

Commit 164ba32

Browse files
stopcoderRandomByte
authored andcommitted
[FIX] Bundles should be built one after another
the current implementation builds multiple bundles in parallel. If there's dependency between the bundles, it can't be resolved correctly. The bundles need to built with the same order as they are specified in the bundle definition.
1 parent 1fb8d00 commit 164ba32

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

lib/types/library/LibraryBuilder.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,19 @@ class LibraryBuilder extends AbstractBuilder {
8383
const bundles = project.builder && project.builder.bundles;
8484
if (bundles) {
8585
this.addTask("generateBundle", () => {
86-
return Promise.all(bundles.map((bundle) => {
87-
return tasks.generateBundle({
88-
workspace: resourceCollections.workspace,
89-
dependencies: resourceCollections.dependencies,
90-
options: {
91-
projectName: project.metadata.name,
92-
bundleDefinition: bundle.bundleDefinition,
93-
bundleOptions: bundle.bundleOptions
94-
}
86+
return bundles.reduce(function(sequence, bundle) {
87+
return sequence.then(function() {
88+
return tasks.generateBundle({
89+
workspace: resourceCollections.workspace,
90+
dependencies: resourceCollections.dependencies,
91+
options: {
92+
projectName: project.metadata.name,
93+
bundleDefinition: bundle.bundleDefinition,
94+
bundleOptions: bundle.bundleOptions
95+
}
96+
});
9597
});
96-
}));
98+
}, Promise.resolve());
9799
});
98100
}
99101

0 commit comments

Comments
 (0)