Skip to content

Commit

Permalink
Attempt to fix parcel-bundler#2340
Browse files Browse the repository at this point in the history
  • Loading branch information
Emil Persson committed Dec 7, 2018
1 parent 21d6cde commit 8c0195d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/core/parcel-bundler/src/Bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ class Bundle {
return bundle;
}

addChildBundle(bundle) {
this.childBundles.add(bundle);
}

addSiblingBundle(bundle) {
this.addChildBundle(bundle);
this.siblingBundles.add(bundle);
}

get isEmpty() {
return this.assets.size === 0;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/parcel-bundler/src/Bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ class Bundler extends EventEmitter {
if ((dep && dep.dynamic) || !bundle.type) {
// If the asset is already the entry asset of a bundle, don't create a duplicate.
if (isEntryAsset) {
bundle.addChildBundle(asset.parentBundle);
return;
}

Expand All @@ -665,6 +666,7 @@ class Bundler extends EventEmitter {
) {
// If the asset is already the entry asset of a bundle, don't create a duplicate.
if (isEntryAsset) {
bundle.addSiblingBundle(asset.parentBundle);
return;
}

Expand Down

0 comments on commit 8c0195d

Please sign in to comment.