How to generate index.js
as ESM?
#1361
Unanswered
raphaelmenges
asked this question in
Q&A
Replies: 1 comment 5 replies
-
The generated commonjs file compatible with both commonjs & esm modules. For example, these imports are both valid: |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working in a ESM environment and would like to have all dependencies as module, too. However, napi-rs generates a
index.js
that follows the commonJS style, even when I define"type": "module"
in thepackage.json
[1]. I was looking through the issues and discussions but could not find any indication how to achieve this.[1] https://www.typescriptlang.org/docs/handbook/esm-node.html
Beta Was this translation helpful? Give feedback.
All reactions