-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
support node.js module.createRequire() #4274
Comments
Yes, that should be handled by the CommonJS plugin (effectively turning an ESM module into a mixed module). Will definitely be really tricky, though. Better not rely on this feature working in any foreseeable future. |
yeah, was just browsing thru the
might be not worth the effort then. I feel like any time spend on |
What is your recommendation for a library to support esbuild/vite & rollupjs while requiring/importing cjs modules from an esm module? |
Until there is support for |
Feature Use Case
not quite sure who's responsibility this would fall in, I assume
rollup
as well as thecommonjs plugin
.https://nodejs.org/dist/latest-v17.x/docs/api/module.html#modulecreaterequirefilename
use case reference: sindresorhus/cli-spinners#58
index.js
foo.json
currently bundled:
I'd imagine it would bundle to something along the lines of:
The text was updated successfully, but these errors were encountered: