test: lock chunk filenames stay verbatim for scoped names#21006
Conversation
Regression test ensuring webpack does not URL-encode '@' (or other special characters) in entry names or webpackChunkName values. Mirrors the concern raised in jantimon/html-webpack-plugin#1771 against the plugin and pins the expected webpack-side behavior.
|
|
This PR is packaged and the instant preview is available (916810e). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@916810e
yarn add -D webpack@https://pkg.pr.new/webpack@916810e
pnpm add -D webpack@https://pkg.pr.new/webpack@916810e |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21006 +/- ##
==========================================
+ Coverage 90.94% 91.62% +0.68%
==========================================
Files 573 573
Lines 58986 59232 +246
Branches 15898 15995 +97
==========================================
+ Hits 53647 54274 +627
+ Misses 5339 4958 -381
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a new config-case regression test to ensure chunk/entry filenames derived from scoped names (e.g. @scope/app and webpackChunkName: "@scope/chunk") remain verbatim and are not URL-encoded (notably @ → %40). This protects webpack’s emitted asset naming behavior that downstream tooling (e.g. html-webpack-plugin) relies on.
Changes:
- Add a new config case with an entry named
@scope/appand a dynamic import chunk named@scope/chunk. - Configure output naming to surface the raw
[name]in bothfilenameandchunkFilename. - Assert that the expected chunk file path is emitted and that the dynamic import executes successfully.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/configCases/entry/scoped-name/webpack.config.js | New config case using scoped entry name and chunk name with [name]-based output patterns. |
| test/configCases/entry/scoped-name/test.config.js | Validates the chunk is emitted at chunks/@scope/chunk.js (verbatim, not URL-encoded) and selects the scoped entry bundle to execute. |
| test/configCases/entry/scoped-name/index.js | Executes a dynamic import with webpackChunkName: "@scope/chunk" and asserts the chunk’s exports load correctly. |
| test/configCases/entry/scoped-name/chunk.js | Provides a simple exported value for the async chunk to validate loading. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merging this PR will degrade performance by 34.79%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Regression test ensuring webpack does not URL-encode '@' (or other
special characters) in entry names or webpackChunkName values. Mirrors
the concern raised in jantimon/html-webpack-plugin#1771 against the
plugin and pins the expected webpack-side behavior.