Skip to content

fix: separate inline assets by environment to prevent multi-compiler overrides#6889

Merged
GiveMe-A-Name merged 1 commit intomainfrom
fix/inline-chunk-plugin-should-seperate-mutlicompiler-
Jan 5, 2026
Merged

fix: separate inline assets by environment to prevent multi-compiler overrides#6889
GiveMe-A-Name merged 1 commit intomainfrom
fix/inline-chunk-plugin-should-seperate-mutlicompiler-

Conversation

@GiveMe-A-Name
Copy link
Copy Markdown
Member

@GiveMe-A-Name GiveMe-A-Name commented Jan 5, 2026

Summary

The inline-chunk plugin previously shared a single inlinedAssets Set across all environments, causing assets to be overridden in multi-compiler scenarios.

Changes:

  • Replace single Set with Map<environmentName, Set> for environment isolation
  • Add getInlinedAssetsSet helper to manage per-environment asset sets
  • Update all functions to accept environment-specific inlinedAssets parameter
  • Add asset existence check before processing
  • Add E2E test for multi-environment inlining

Fixes: inline-chunk plugin should separate multiCompiler by environment

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings January 5, 2026 04:50
@netlify
Copy link
Copy Markdown

netlify bot commented Jan 5, 2026

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit f8ba818
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/695b4b001190d60008e0845e
😎 Deploy Preview https://deploy-preview-6889--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 59 (🔴 down 9 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

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

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 fixes a bug in the inline-chunk plugin where assets were being overridden in multi-compiler scenarios due to a shared inlinedAssets Set across all environments.

Key Changes:

  • Replace single shared Set with a Map structure that maintains separate Sets per environment
  • Add getInlinedAssetsSet helper function for lazy initialization of per-environment asset tracking
  • Update all inline processing functions to accept and use environment-specific asset Sets
  • Add defensive asset existence check in the cleanup stage
  • Add comprehensive E2E test validating independent inlining across multiple environments

Reviewed changes

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

File Description
packages/core/src/plugins/inlineChunk.ts Refactored asset tracking from single Set to Map-based per-environment Sets, updated function signatures to pass environment-specific Sets, and added asset existence validation
e2e/cases/output/inline-chunk/index.test.ts Added test case verifying that assets are inlined independently for multiple environments with different output paths

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…overrides

The inline-chunk plugin previously shared a single `inlinedAssets` Set across
all environments, causing assets to be overridden in multi-compiler scenarios.

Changes:
- Replace single Set with Map<environmentName, Set> for environment isolation
- Add getInlinedAssetsSet helper to manage per-environment asset sets
- Update all functions to accept environment-specific inlinedAssets parameter
- Add asset existence check before processing
- Add E2E test for multi-environment inlining

Fixes: inline-chunk plugin should separate multiCompiler by environment
@GiveMe-A-Name GiveMe-A-Name force-pushed the fix/inline-chunk-plugin-should-seperate-mutlicompiler- branch from 4786ab7 to f8ba818 Compare January 5, 2026 05:24
@GiveMe-A-Name GiveMe-A-Name enabled auto-merge (squash) January 5, 2026 05:42
@GiveMe-A-Name GiveMe-A-Name merged commit 3524618 into main Jan 5, 2026
10 checks passed
@GiveMe-A-Name GiveMe-A-Name deleted the fix/inline-chunk-plugin-should-seperate-mutlicompiler- branch January 5, 2026 05:47
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