Skip to content

Comments

fix(builder): use original config to check inlineScripts setting#8353

Merged
caohuilin merged 2 commits intomainfrom
fix/builder-test
Feb 24, 2026
Merged

fix(builder): use original config to check inlineScripts setting#8353
caohuilin merged 2 commits intomainfrom
fix/builder-test

Conversation

@caohuilin
Copy link
Member

The previous fix (ece3967) changed the condition from !config.output.inlineScripts to config.output.inlineScripts === undefined, which broke the default runtime chunk inlining. In Rsbuild 2.0, the default value of inlineScripts changed from undefined to false, so the merged config always has false and the condition never matches.

Fix by checking api.getRsbuildConfig('original') to inspect the user's original config before Rsbuild defaults are merged. This correctly distinguishes between "user didn't set inlineScripts" (should use default regex) and "user explicitly set inlineScripts: false" (should respect user's choice).

Summary

Related Links

Checklist

  • I have added changeset via pnpm run change.
  • I have updated the documentation.
  • I have added tests to cover my changes.

The previous fix (ece3967) changed the condition from `!config.output.inlineScripts`
to `config.output.inlineScripts === undefined`, which broke the default runtime chunk
inlining. In Rsbuild 2.0, the default value of `inlineScripts` changed from `undefined`
to `false`, so the merged config always has `false` and the condition never matches.

Fix by checking `api.getRsbuildConfig('original')` to inspect the user's original config
before Rsbuild defaults are merged. This correctly distinguishes between "user didn't set
inlineScripts" (should use default regex) and "user explicitly set inlineScripts: false"
(should respect user's choice).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@netlify
Copy link

netlify bot commented Feb 14, 2026

Deploy Preview for modernjs-byted ready!

Name Link
🔨 Latest commit 0d78cff
🔍 Latest deploy log https://app.netlify.com/projects/modernjs-byted/deploys/699d54aa0a9f870008e04b88
😎 Deploy Preview https://deploy-preview-8353--modernjs-byted.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: 93 (🔴 down 6 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

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

@changeset-bot
Copy link

changeset-bot bot commented Feb 14, 2026

🦋 Changeset detected

Latest commit: 0d78cff

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 109 packages
Name Type
@modern-js/builder Patch
@modern-js/plugin-bff Patch
@modern-js/server Patch
@modern-js/app-tools Patch
@modern-js/plugin Patch
rsc-ssr-app Patch
bff-api-app Patch
bff-client-app Patch
bff-indep-client-app Patch
bff-hono Patch
deploy-server Patch
pure-esm-project Patch
@modern-js/plugin-ssg Patch
@modern-js/plugin-styled-components Patch
@modern-js/plugin-i18n Patch
@modern-js/image Patch
@modern-js/runtime Patch
@modern-js/plugin-polyfill Patch
@integration-test/alias-set Patch
app-document Patch
async-entry-test Patch
tmp Patch
integration-clean-dist-path Patch
integration-compatibility Patch
integration-custom-dist-path Patch
custom-file-system-entry Patch
integration-custom-template Patch
deploy Patch
dev-server Patch
integration-disable-html Patch
entries-app-builder Patch
app-custom-entries Patch
app-custom-routes-runtime Patch
app-custom Patch
app-entry Patch
app-route Patch
app-entry-server Patch
i18n-app-csr-html-lang Patch
i18n-app Patch
i18n-app-ssr-html-lang Patch
i18n-app-ssr Patch
i18n-custom-i18n-wrapper Patch
i18n-mf-app-provider Patch
i18n-mf-component-provider Patch
i18n-mf-consumer Patch
i18n-routes Patch
i18n-routes-ssr Patch
@integration-test/image-component Patch
main-entry-name Patch
nonce Patch
routes-match Patch
routes Patch
app-rsbuild-hooks Patch
rsc-csr-app Patch
rsc-csr-routes Patch
rsc-ssr-routes Patch
runtime-custom-plugin Patch
runtime-custom-config-plugin Patch
select-mul-entry-test Patch
select-one-entry-test Patch
server-config Patch
server-json-script Patch
server-monitors Patch
server-prod Patch
server-routes Patch
@source-code-build/app Patch
ssg-fixtures-mega-list-routes Patch
ssg-fixtures-nested-routes Patch
ssg-fixtures-simple Patch
ssg-fixtures-web-server Patch
ssr-base-async-entry-test Patch
ssr-base-json-test Patch
ssr-base-test Patch
ssr-base-fallback-test Patch
init Patch
ssr-base-loadable Patch
ssr-partial-test Patch
ssr-script-loading Patch
ssr-streaming-inline-test Patch
ssr-streaming-test Patch
styled-components-stream Patch
styled-components-string Patch
integration-tailwindcss-v2 Patch
integration-tailwindcss-v3 Patch
integration-tailwindcss-v4 Patch
tmp-dir Patch
write-to-dist Patch
@modern-js/bundle-diff-benchmark Patch
@modern-js/main-doc Patch
@modern-js/tsconfig Patch
@modern-js/plugin-data-loader Patch
@modern-js/render Patch
@modern-js/bff-core Patch
@modern-js/bff-runtime Patch
@modern-js/server-core Patch
@modern-js/create-request Patch
@modern-js/prod-server Patch
@modern-js/server-runtime Patch
@modern-js/server-utils Patch
@modern-js/create Patch
@modern-js/i18n-utils Patch
@modern-js/runtime-utils Patch
@modern-js/sandpack-react Patch
@modern-js/types Patch
@modern-js/utils Patch
@modern-js/rslib Patch
@scripts/prebundle Patch
@scripts/rstest-config Patch
@scripts/release-node Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2026

Rsdoctor Bundle Diff Analysis

⚠️ Note: The latest commit (992b500e77) does not have baseline artifacts. Using commit 6a94134f12 for baseline comparison instead. If this seems incorrect, please wait a few minutes and try rerunning the workflow.

📊 Quick Summary
Project Total Size Change
bundle-diff 2.9 MB -20.4 KB (-0.7%)
📋 Detailed Reports (Click to expand)

📁 bundle-diff

Path: benchmark/bundle-diff/dist/rsdoctor-data.json

📌 Baseline Commit: 6a94134f12 | PR: #8358

Metric Current Baseline Change
📊 Total Size 2.9 MB 2.9 MB -20.4 KB (-0.7%)
📄 JavaScript 495.3 KB 499.7 KB -4.4 KB (-0.9%)
🎨 CSS 1.2 KB 1.2 KB 0
🌐 HTML 5.9 KB 1.6 KB +4.3 KB (+259.0%)
📁 Other Assets 2.4 MB 2.4 MB -20.2 KB (-0.8%)

📦 Download Diff Report: bundle-diff Bundle Diff

Generated by Rsdoctor GitHub Action

@caohuilin caohuilin enabled auto-merge (squash) February 14, 2026 05:16
@caohuilin caohuilin merged commit a270428 into main Feb 24, 2026
10 checks passed
@caohuilin caohuilin deleted the fix/builder-test branch February 24, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants