Skip to content
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] Incorrect compilation of this in field declaration inside a class. #1479

Closed
quangloc99 opened this issue Apr 13, 2023 · 1 comment · Fixed by #1507

Comments

@quangloc99
Copy link

Expected Behavior

this inside class A should be preserved after commonjs transformation.

When running npm run exec:dev, the output is 1.

Actual Behavior

this inside class A is transformed into commonjsGlobal.

When running npm run exec:build, an error is thrown.

Additional Information

The check here is heuristic. It does not check for the case of class.

@lukastaegert
Copy link
Member

A PR that adds a test case and improves the check would be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants