-
-
Notifications
You must be signed in to change notification settings - Fork 559
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
[@rollup/plugin-commonjs] commonjs does not recognize named cjs exports #1678
Comments
I think my use case is related. I noticed that My input file import {foo} from "foo"
console.log(foo) The // foo/index.js
Object.defineProperty(exports, "foo", { enumerable: true, get: function () { return 123; } }); A bundle produced by Rollup outputs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to transpile CJS to ESM until prisma/prisma#5030 is addressed. I'm having a hard time doing so as I can't quite get the pieces together.
Expected Behavior
The commonjs plugin properly detects all named exports
Actual Behavior
No named exports are found
Additional Information
There is a node-backed package that does a pretty solid named exports analysis, which works for my specific use case. I've added a
npm run cjs-lex
command in the repro to show how it worksThe text was updated successfully, but these errors were encountered: