Skip to content

fix(core): update runtime chunk config for multiple entries#1551

Merged
JSerFeng merged 1 commit intomainfrom
david/fix/core-runtime-chunk-multi-entry
Mar 24, 2026
Merged

fix(core): update runtime chunk config for multiple entries#1551
JSerFeng merged 1 commit intomainfrom
david/fix/core-runtime-chunk-multi-entry

Conversation

@Timeless0911
Copy link
Copy Markdown
Contributor

@Timeless0911 Timeless0911 commented Mar 24, 2026

Summary

Updates the default ESM runtimeChunk behavior so bundled single-entry builds stop emitting a separate runtime chunk, while multi-entry builds still get a stable runtime chunk name.

Also adds direct coverage for getRuntimeChunkConfig and refreshes the affected integration snapshots for the new output layout.

Related Links

close: #1487

Checklist

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

Copilot AI review requested due to automatic review settings March 24, 2026 07:12
@JSerFeng JSerFeng merged commit a4b4b64 into main Mar 24, 2026
12 checks passed
@JSerFeng JSerFeng deleted the david/fix/core-runtime-chunk-multi-entry branch March 24, 2026 07:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts Rslib’s default ESM runtimeChunk behavior to avoid emitting a separate runtime chunk for bundled single-entry builds, while keeping a stable runtime chunk name for multi-entry builds (including multi-compiler prefixes). It also adds unit coverage for the runtime-chunk decision logic and updates affected integration snapshots to reflect the new output layout.

Changes:

  • Update ESM optimization config to compute runtimeChunk via a new getRuntimeChunkConfig helper.
  • Add unit tests for getRuntimeChunkConfig and update config snapshots.
  • Refresh multiple integration snapshots impacted by the new runtime chunk behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/integration/resolve/index.test.ts Updates snapshots and expectations for changed ESM output/runtime layout.
tests/integration/minify/index.test.ts Refreshes snapshot whitespace in minify-disabled output.
tests/integration/copy/index.test.ts Updates dist tree snapshot reflecting new emitted artifacts.
tests/integration/asset/index.test.ts Updates public-path snapshot now that runtime is inlined into the entry for bundled single-entry ESM.
packages/core/tests/config.test.ts Adds direct unit coverage for getRuntimeChunkConfig.
packages/core/tests/snapshots/config.test.ts.snap Updates composed config snapshots to reflect runtimeChunk: undefined for bundled single-entry ESM.
packages/core/src/config.ts Introduces getRuntimeChunkConfig and wires it into ESM optimization config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: experiments.advancedEsm default value true causes __webpack_require__ runtime in ESM output and build failures

3 participants