-
Notifications
You must be signed in to change notification settings - Fork 26
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
Unable to detect exports from bundled webpack output #88
Comments
https://github.com/nodejs/cjs-module-lexer#project-status This project has been frozen, I suspect webpack may have relevant options that will follow this. |
Yeah, I noticed that. Would be cool if we can configure webpack to output compatible code, yeah. Might have to create a manual re-export facade thing if not. Or just accept interop is not the best and have people use default export. |
webpack/webpack#13098 Unfortunately webpack doesn't support this, although rollup does. |
Happy to switch to rollup (vite probably?) instead - I'm not particularly married to using webpack (it's just the one I got working (and the one I have by far the most experience with)) |
FWIW, I think I'll just be checking the exports manually at build time and include an |
Amazing! |
Title is probably inaccurate 😅
I recently added bundling to Jest, and it seems the output makes the lexer not detect exports correctly.
Specifically, it picks up the
exports.
stuff that is not exported, but not the exports withinObject.definedProperty
which actually are.Quickest reproduction I have is to clone Jest, run
yarn && yarn build:js
then this:This prints
Running the parser on the published version (29.7.0) gives this:
The reexports are of course gone as it's bundled, but we're also seeing that the lexer has detected only the resolved re-exports?
The text was updated successfully, but these errors were encountered: