You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assuming that paths in the Babel output are relative, we could simply import() any given file and assume that everything else will follow. However this means code runs from a different directory leading to subtle failures.
Once we resolve this, we could add a default mjs extension, though this would be a breaking change.
It's unclear to me how we would load compiled ESM files.
Our current approach is to install a hook on
require.extensionsbut this is ignored for ESM files: https://github.com/avajs/babel/blob/c9de6fc63f9bc61abcdfbc99ebf734c1ad5a9210/index.js#L366:L369Assuming that paths in the Babel output are relative, we could simply
import()any given file and assume that everything else will follow. However this means code runs from a different directory leading to subtle failures.Once we resolve this, we could add a default
mjsextension, though this would be a breaking change.