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: allow all characters for webpackChunkName #6411

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

xc2
Copy link
Collaborator

@xc2 xc2 commented Apr 29, 2024

Summary

Webpack allows any string for webpackChunkName: https://github.com/webpack/webpack/blob/c586c7b1e027e1d252d68b4372f08a9bce40d96c/lib/javascript/JavascriptParser.js#L4584-L4587

fixes #6358

Just a quick fix.

Known issues (Edge cases)

  • will not work with texts containing the character that is same as the quote character, e.g, "a\\"b" (rust's regex does not support backreference)
  • still does not support all js expressions like Boolean(1) which seems to be allowed in webpack

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added the release: bug fix release: bug related release(mr only) label Apr 29, 2024
Copy link

netlify bot commented Apr 29, 2024

Deploy Preview for rspack canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 0275972
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/662fca10234ad10008ee25ea

@xc2 xc2 marked this pull request as ready for review April 29, 2024 17:05
@xc2 xc2 requested a review from ahabhgk April 29, 2024 17:05
Copy link
Contributor

@ahabhgk ahabhgk left a comment

Choose a reason for hiding this comment

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

I am contemplating the use of JSON for data parsing (JSON based + Regex support for webpackInclude/Exclude, or just a JS parser). While it has its drawbacks, it should be adequate for the majority of use cases.

@ahabhgk ahabhgk merged commit 2e9355e into web-infra-dev:main Apr 30, 2024
30 checks passed
@xc2 xc2 deleted the fix-6358 branch April 30, 2024 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: bug fix release: bug related release(mr only)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: webpackChunkName not used if name contains period
2 participants