Skip to content

ES6 support when using import instead of require #5

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

Closed
subhranshudas opened this issue Apr 2, 2018 · 5 comments
Closed

ES6 support when using import instead of require #5

subhranshudas opened this issue Apr 2, 2018 · 5 comments

Comments

@subhranshudas
Copy link

subhranshudas commented Apr 2, 2018

Hi,

Is there any way we can use this package to use for ES6's import syntax?

Thanks.

Regards,
Subhranshu

@watson
Copy link
Member

watson commented Jun 12, 2018

Are you already using the experimental ESM support in Node.js or are you transpiling your code? We should work just fine with transpiled code as that will just use require after being transpiled.

But we will need to add support for native ESM at some point, but ESM support in Node.js is currently experimental and should not be used in production.

In any case, it should be possible for us add support for ESM by using a custom loader: https://nodejs.org/api/esm.html#esm_loader_hooks

@watson
Copy link
Member

watson commented Mar 14, 2019

Closing this for now due to lack of activity. Feel free to comment if you think it should be re-opened 🙂

@ebuildy
Copy link

ebuildy commented Jan 28, 2021

Hello,

is it something planned? Or maybe a way to force the detection?

Thanks you,

@trentm
Copy link
Contributor

trentm commented Jan 29, 2021

Hi @ebuildy, yes supporting ES modules is on radar. I'm not positive it would land in this module as the mechanism for hooking into imports will be different. elastic/apm-agent-nodejs#1952 is probably a better issue to use to track this.

@shikloshi
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants