[@rollup/plugin-commonjs] How-to use with native node modules #1416
Unanswered
raphaelmenges
asked this question in
Q&A
Replies: 2 comments 2 replies
-
@raphaelmenges Have you managed to sole the issue? |
Beta Was this translation helpful? Give feedback.
1 reply
-
import { createRequire } from "module";
export const nodeRequire = createRequire(import.meta.url); Please use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello 👋
I am using Rollup through Vite 4 and have a hard time to bundle native Node.js modules that are (still) using commonjs style. In specifically, i am facing following issues:
.node
files, even though the documentation states only".cjs"
are considered by default..node
binaries seem to be resolved in relation to the project root, not the module that is requiring them.I assume it might be fixable through choosing the correct options. Does anyone know details or has an example at hand how to handle modules in commonjs style that require
.node
binaries?Beta Was this translation helpful? Give feedback.
All reactions