Skip to content

Commit

Permalink
[FIX] Bundles should be built one after another
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stopcoder authored and RandomByte committed Jun 26, 2018
1 parent 1fb8d00 commit 164ba32
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/types/library/LibraryBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,19 @@ class LibraryBuilder extends AbstractBuilder {
const bundles = project.builder && project.builder.bundles;
if (bundles) {
this.addTask("generateBundle", () => {
return Promise.all(bundles.map((bundle) => {
return tasks.generateBundle({
workspace: resourceCollections.workspace,
dependencies: resourceCollections.dependencies,
options: {
projectName: project.metadata.name,
bundleDefinition: bundle.bundleDefinition,
bundleOptions: bundle.bundleOptions
}
return bundles.reduce(function(sequence, bundle) {
return sequence.then(function() {
return tasks.generateBundle({
workspace: resourceCollections.workspace,
dependencies: resourceCollections.dependencies,
options: {
projectName: project.metadata.name,
bundleDefinition: bundle.bundleDefinition,
bundleOptions: bundle.bundleOptions
}
});
});
}));
}, Promise.resolve());
});
}

Expand Down

0 comments on commit 164ba32

Please sign in to comment.