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

fix(esm-shim): do not insert shims at import literal #1696

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

younggglcy
Copy link
Contributor

@younggglcy younggglcy commented Mar 17, 2024

Rollup Plugin Name: @rollup/plugin-esm-shim

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

resolves #1649

Description

See the repro #1649 given, the shims were inserted into wrong position because the object

{
  keyword: ' import',
  dn: '',
};

matches the ESMStaticImportRegex regex.

This PR fixes it by disallowing \n in the specifier group in the regex.

@younggglcy younggglcy requested a review from tada5hi as a code owner March 17, 2024 15:08
@tada5hi
Copy link
Member

tada5hi commented Mar 18, 2024

looking good

@younggglcy
Copy link
Contributor Author

ping politely here. can anyone help merge this pr

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@lukastaegert lukastaegert merged commit 1795863 into rollup:master Apr 5, 2024
10 checks passed
@younggglcy younggglcy deleted the fix/issue_1649 branch April 5, 2024 05:34
younggglcy added a commit to younggglcy/plugins that referenced this pull request Jun 6, 2024
* fix: update regex to do not match new line in specifier group

* test: add testcases and update snapshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants