-
-
Notifications
You must be signed in to change notification settings - Fork 366
Closed
Description
In ESM projects, where napi bindings are just one part of the repo, mixing ESM and CJS files can be a huge pain.
It would be nice for napi-rs to generate an index.js that is valid ESM.
At a bare minimum, this can be done by adding the following lines to the top of the generated file:
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const __dirname = new URL('.', import.meta.url).pathname;and updating the exports.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels