Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.2k
fix: use new URL() for dynamic imports in ESM library output#19814
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
8eef1ac toa4027eaComparecodspeed-hqbot commentedAug 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
CodSpeed Performance ReportMerging#19814 willdegrade performances by 31.01%Comparing Summary
Benchmarks breakdown
|
e98d574 to49984f1Compare49984f1 tocf2634dCompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Description:
For ESM libraries (
experiments.outputModule+library.type: "module"), replace runtime string concatenation with a compile‑timechunkId → URLmapping and emitimport(new URL("<literal>", import.meta.url).href). This makes dynamic imports statically analyzable by other bundlers and robust underfile://, while avoiding unused__webpack_require__.u/publicPathcode.Fixes:
Testing:
Added
test/configCases/library/module-dynamic-import-urlto assert:new URL(..., import.meta.url).hrefin output__webpack_require__.uand publicPath concatenationBreaking Changes:
None
Documentation Updates:
na
Related:
Part of#17121