Skip to content

Conversation

@fi3ework
Copy link
Member

Summary

to fix the case added in test cases, multi-compiler don't know other compilers' existence, so it's prone to emit chunk file to same path, whereas the content might not the same. this it's not prone to happen in Rsbuild as the hash is enabled but hash is disabled in Rslib.

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings September 12, 2025 08:48
Copy link
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

Fixes chunk filename conflicts in multi-compiler builds by adding index prefixes to chunk filenames. This prevents multiple compilers from generating chunks with identical filenames that could overwrite each other when hash is disabled.

  • Added composeOutputConfig function to prefix chunk filenames with compiler index in multi-compiler scenarios
  • Updated composeLibRsbuildConfig and composeCreateRsbuildConfig to pass compiler index information
  • Added comprehensive test cases for both single and multi-compiler chunk naming scenarios

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/core/src/config.ts Added output config composition and multi-compiler index tracking
tests/integration/output/index.test.ts Added test cases for chunk filename behavior verification
tests/integration/output/chunkFileName-multi/ Multi-compiler test fixture with shared dependencies
tests/integration/output/chunkFileName-single/ Single-compiler test fixture for baseline comparison
packages/core/tests/snapshots/config.test.ts.snap Updated snapshots reflecting new chunk filename patterns
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@netlify
Copy link

netlify bot commented Sep 12, 2025

Deploy Preview for rslib ready!

Name Link
🔨 Latest commit 2535c8e
🔍 Latest deploy log https://app.netlify.com/projects/rslib/deploys/68c3ec4c303c4700088cd493
😎 Deploy Preview https://deploy-preview-1220--rslib.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@fi3ework fi3ework force-pushed the mul branch 4 times, most recently from e3ea64b to 2535c8e Compare September 12, 2025 09:47
@fi3ework fi3ework force-pushed the mul branch 2 times, most recently from c9af289 to 6807abe Compare September 15, 2025 07:54
@fi3ework fi3ework requested a review from Copilot September 15, 2025 08:40
Copy link
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

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Timeless0911 Timeless0911 enabled auto-merge (squash) September 15, 2025 09:28
@Timeless0911 Timeless0911 changed the title fix: avoid chunk conflication when muliple libs present fix: avoid chunk conflicts when multiple libs are present Sep 15, 2025
@Timeless0911 Timeless0911 merged commit d50c33c into main Sep 15, 2025
14 checks passed
@Timeless0911 Timeless0911 deleted the mul branch September 15, 2025 09:31
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.

3 participants