The output produced by webpack's asset/resource and asset/source loaders is just a plain CJS module with no es compatibility built in. Since ember-auto-import turns the user's import into a require() in the entryfile, webpack doesn't have any reason to know to add cjs compatibility. This results in not getting a default export on the resulting module.
This change adds general es-compatibility checking to our require() calls. This is exactly the same as embroider already does.
The output produced by webpack's
asset/resource
andasset/source
loaders is just a plain CJS module with no es compatibility built in. Since ember-auto-import turns the user'simport
into arequire()
in the entryfile, webpack doesn't have any reason to know to add cjs compatibility. This results in not getting adefault
export on the resulting module.This change adds general es-compatibility checking to our
require()
calls. This is exactly the same as embroider already does.