Skip to content

Commit

Permalink
always add bundle-loader module to the bundle (#686)
Browse files Browse the repository at this point in the history
* always add the bundle-loader module

* check if the asset is already in the bundle
  • Loading branch information
albizures authored and devongovett committed Jan 29, 2018
1 parent f9be820 commit deba5ef
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/packagers/JSPackager.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ class JSPackager extends Packager {
}

async addAssetToBundle(asset) {
if (this.bundle.assets.has(asset)) {
return;
}
this.bundle.addAsset(asset);
if (!asset.parentBundle) {
asset.parentBundle = this.bundle;
Expand All @@ -124,10 +127,11 @@ class JSPackager extends Packager {
);
if (this.externalModules.size > 0 && !bundleLoader) {
bundleLoader = await this.bundler.getAsset('_bundle_loader');
await this.addAssetToBundle(bundleLoader);
}

if (!bundleLoader) {
if (bundleLoader) {
await this.addAssetToBundle(bundleLoader);
} else {
return;
}

Expand Down

0 comments on commit deba5ef

Please sign in to comment.