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
{{ message }}
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
I can understand having the --loader argument since custom loader's are ESM files with specific exports, is it possible to implement an API for this (module.addESMLoader or something)? The idea is that during startup of nyc we hook require.extensions for CJS, we'd like to also hook ESM module loaders. If we need to control the --loader argument of node.js this will be difficult.
I suspect this will apply to other transformation plugins. Thinking about how a module like @babel/register gets documented. If users need to use --loader to get babel working with ESM I think that will create confusion.
The text was updated successfully, but these errors were encountered:
i work on an apm product of which a critical component is being able to patch modules as they are loaded. i think this is a related issue and just want to put in a word that i'm interested in your thoughts and the state of any potential solutions. feel free to point me elsewhere if this isn't the right place.
I'm also interested in getting an API regarding this.
transformation plugins and APM tools currently monkey patch Module.prototype.require, Module._load or similar which is not that nice and will for sure not work with ECMAModules.
The need to specify extra command line arguments, which even have a dependency to other command line arguments (at least currently to --experimental-modules) and fail on older Node.Js versions result in hard to maintain setups.
Currently the only requirement is to have the transformation plugins loaded early and they care about the rest. With ESM it looks like users have to care about one more topic.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I can understand having the
--loader
argument since custom loader's are ESM files with specific exports, is it possible to implement an API for this (module.addESMLoader or something)? The idea is that during startup of nyc we hookrequire.extensions
for CJS, we'd like to also hook ESM module loaders. If we need to control the--loader
argument of node.js this will be difficult.I suspect this will apply to other transformation plugins. Thinking about how a module like
@babel/register
gets documented. If users need to use--loader
to get babel working with ESM I think that will create confusion.The text was updated successfully, but these errors were encountered: