-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(node): Allow to pass registerEsmLoaderHooks
to preload
#12998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and agree on keeping the name aligned with the init
option.
Users can then write their own custom preload script and configure this there, if wanted.
Sounds fair, given this won't be a widely used option. We should just make sure to document this because right now, we only show how to set integrations and debug via env variables.
As mentioned in here: #12912 (comment) there is no way today to exclude/include esm modules when preloading today.
This PR adds the option to pass
registerEsmLoaderHooks
as option topreloadOpenTelemetry
, which allows to exclude/include packages there as well. Users can then write their own custompreload
script and configure this there, if wanted.Naming
I chose to use the same option naming here than for
init
, although the semantics are a bit different - here we can't actually disable the wrapping (because that's the only reason to even call this). We can also use a different name if we want, but I thought this would maybe be easier to understand that this is the same thing 🤔