Skip to content

Commit

Permalink
Respect v2 addon's explicit external list
Browse files Browse the repository at this point in the history
As a compatibility feature, v2 addons are allowed to list externals in the package metadata. These are dependencies that should be resolved at runtime from the surrounding environment, not at build time. Embroider respects this option but ember-auto-import does not.
  • Loading branch information
ef4 committed Oct 13, 2022
1 parent 9a2887f commit 40c0918
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/ember-auto-import/ts/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ export default class WebpackBundler extends Plugin implements Bundler {
return callback();
}

if (pkg.meta.externals?.includes(name)) {
return callback(undefined, 'commonjs ' + request);
}

try {
let found = packageCache.resolve(name, pkg);
if (!found.isEmberPackage() || found.isV2Addon()) {
Expand Down

0 comments on commit 40c0918

Please sign in to comment.