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
fix(commonjs): convert module.exports with __esModule
property(#939)
#942
Conversation
@githoniel as well as the unit test here, could you include a full end-to-end test of the original use case provided in #939? It looks like the output of that test is currently:
Can you clarify what the output of that same test becomes with this PR? |
486cc69
to
34ba4ce
Compare
@guybedford thank for your time. Look at this https://replit.com/@githoniel/rollup-plugin-repro-1 or the linked issue #939 many old package include babel-runtime publish its code like below
import it will get an object as
I have add test sample for it |
One issue here is this is the opposite interop pattern to Node.js itself... making this plugin unsuitable for building Node.js applications. |
any idea?shall we add option like |
@githoniel I believe this is supposed to be controled by the |
I have make it work and update new tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work checking these cases, thanks for the PR.
I know the prettier issue is unrelated, but are you able to get the CI to pass on this PR? |
Finally passing - thanks again for your work on this. |
Rollup Plugin Name:
commonjs
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers: #939
Description
transform commonjs as
module.exports = { __esModule: true, default: ... }
to wrap runtime code