Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
3ru wants to merge4 commits intowebpack:main
base:main
Choose a base branch
Loading
from3ru:fix/esm-library-dynamic-import-new-url

Conversation

@3ru
Copy link
Member

@3ru3ru commentedAug 17, 2025
edited
Loading

Description:
For ESM libraries (experiments.outputModule +library.type: "module"), replace runtime string concatenation with a compile‑timechunkId → URL mapping 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/publicPath code.

Fixes:

Testing:
Addedtest/configCases/library/module-dynamic-import-url to assert:

  • presence ofnew URL(..., import.meta.url).href in output
  • absence of__webpack_require__.u and publicPath concatenation
  • dynamic import executes successfully

Breaking Changes:
None

Documentation Updates:
na

Related:
Part of#17121

xiaoxiaojx reacted with thumbs up emoji
@3ru3ruforce-pushed thefix/esm-library-dynamic-import-new-url branch from8eef1ac toa4027eaCompareAugust 17, 2025 07:01
@codspeed-hq
Copy link

codspeed-hqbot commentedAug 17, 2025
edited
Loading

CodSpeed Performance Report

Merging#19814 willdegrade performances by 31.01%

Comparing3ru:fix/esm-library-dynamic-import-new-url (b8c489f) withmain (1f5e8e5)

Summary

⚡ 2 improvements
❌ 1 regression
✅ 39 untouched

⚠️Please fix the performance issues oracknowledge them on CodSpeed.

Benchmarks breakdown

BenchmarkBASEHEADChange
benchmark "devtool-source-map", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}'73.1 ms105.9 ms-31.01%
benchmark "many-modules-commonjs", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}'149.5 ms116.2 ms+28.7%
benchmark "react", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}'124.9 ms97.3 ms+28.45%

@3ru3ruforce-pushed thefix/esm-library-dynamic-import-new-url branch frome98d574 to49984f1CompareAugust 17, 2025 07:36
@3ru3ruforce-pushed thefix/esm-library-dynamic-import-new-url branch from49984f1 tocf2634dCompareAugust 17, 2025 08:21
@3ru3ru marked this pull request as ready for reviewAugust 17, 2025 08:30
@3ru3ru marked this pull request as draftSeptember 1, 2025 02:50
@3ru3ru marked this pull request as ready for reviewSeptember 15, 2025 15:24
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@alexander-akaitalexander-akaitalexander-akait left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@3ru@alexander-akait

[8]ページ先頭

©2009-2025 Movatter.jp