Skip to content

Commit

Permalink
Merge pull request #127 from thoov/eai-lazy-engine-lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue authored May 5, 2022
2 parents b8ea58f + f38f712 commit f542fbc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addon/services/asset-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ export default Ember.Service.extend({
const assets = bundle.assets || [];
const assetPromises = assets.map((asset) => this.loadAsset(asset, retryLoad));

// ember-auto-import creates window.__eaiEngineLookup when a lazy engine uses eai v2.
// this enables lazy engine's imports to be lazy themselves.
if (typeof __eaiEngineLookup === 'object' && __eaiEngineLookup[name]) {
assetPromises.push(__eaiEngineLookup[name]());
}

const bundlePromise = RSVP.allSettled([ ...dependencyPromises, ...assetPromises ]);

const bundleWithFail = bundlePromise.then((promises) => {
Expand Down

0 comments on commit f542fbc

Please sign in to comment.