Skip to content
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

Publish native ES module #298

Closed
dandv opened this issue Sep 25, 2017 · 6 comments
Closed

Publish native ES module #298

dandv opened this issue Sep 25, 2017 · 6 comments

Comments

@dandv
Copy link
Contributor

dandv commented Sep 25, 2017

Node v8.5.0 has just added experimental support for modules behind a flag, and now compliant modules can be imported directly, without any transpiler, if they have the .mjs extension.

By omitting the extension in the main field of package.json, the module will be compatible with Node pre 8.5.0.

@dandv
Copy link
Contributor Author

dandv commented Dec 12, 2017

Update: created repo showing Node being unable to import the FieldType symbol with --experimental-modules.

This commit in my repo localISOdt shows how to add .mjs support:

  • rename index.js to index.mjs
  • change the main field in package.json to index (no extension)
  • adjust the prepare babel script to output the .js

@stale
Copy link

stale bot commented Jun 1, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 1, 2019
@dandv
Copy link
Contributor Author

dandv commented Jun 1, 2019

Maybe this should be tabled until October, when the --experimental-modules flag is expected to drop?

@stale stale bot removed the wontfix label Jun 1, 2019
@bencevans
Copy link
Member

Sounds like a good plan to me. I don't see much point in developing on experimental node flags for node-influx for the time being. Happily accept a PR later along the line though. Closing for now.

@dandv
Copy link
Contributor Author

dandv commented Feb 8, 2020

Any chance to have TypeScript with target and module also set to esnext, now that a few months have passed since Node removed the experimental flag for ES modules?

@bencevans
Copy link
Member

Great, yes! Please submit a PR :shipit:

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

No branches or pull requests

2 participants