fix(core): update runtime chunk config for multiple entries#1551
Merged
fix(core): update runtime chunk config for multiple entries#1551
Conversation
JSerFeng
approved these changes
Mar 24, 2026
Contributor
There was a problem hiding this comment.
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
runtimeChunkvia a newgetRuntimeChunkConfighelper. - Add unit tests for
getRuntimeChunkConfigand 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the default ESM
runtimeChunkbehavior 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
getRuntimeChunkConfigand refreshes the affected integration snapshots for the new output layout.Related Links
close: #1487
Checklist