Skip to content

fix(rsbuild-plugin): add source.include in prod mode only#3971

Merged
2heal1 merged 4 commits intomainfrom
fix/add-include-dev
Aug 6, 2025
Merged

fix(rsbuild-plugin): add source.include in prod mode only#3971
2heal1 merged 4 commits intomainfrom
fix/add-include-dev

Conversation

@2heal1
Copy link
Copy Markdown
Member

@2heal1 2heal1 commented Aug 4, 2025

Description

Add source.include will work in react-refresh-loader as well, which may cause missing $RefreshReg$ in dev mode.

So change it to use detail source.include, if users add extra runtime plugins, add it to source.include by manually.

Related Issue

web-infra-dev/rspack#10524

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 4, 2025

🦋 Changeset detected

Latest commit: 8465470

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

This PR includes changesets to release 33 packages
Name Type
@module-federation/rsbuild-plugin Patch
@module-federation/modern-js Patch
@module-federation/rspress-plugin Patch
remote5 Patch
website-new Patch
@module-federation/runtime Patch
@module-federation/enhanced Patch
@module-federation/rspack Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/sdk Patch
@module-federation/runtime-tools Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/dts-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/devtools Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/retry-plugin Patch
@module-federation/data-prefetch Patch
@module-federation/error-codes Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/runtime-core Patch
create-module-federation Patch
@module-federation/cli Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/storybook-addon Patch
@module-federation/modernjsapp Patch
@module-federation/esbuild Patch
@module-federation/utilities 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

@netlify
Copy link
Copy Markdown

netlify bot commented Aug 4, 2025

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 8465470
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/68917d0ff7cee10008b7b9c1
😎 Deploy Preview https://deploy-preview-3971--module-federation-docs.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.

config.source.include = [
...(config.source.include || []),
/@module-federation[\\/]/,
/@module-federation\/webpack-bundler-runtime/,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we want to preserve the transformations of swc itself, but not hot reload / react refresh related aspects?
Like what if we ship modern syntax like optional chaining and want it to obey user specified transformations?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, this is ideally behavior. But i don't know how to set it ..So I just add specify pkg regexp

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think i had to workaround this in rsbuild react router plugin. Will take a look

@2heal1 2heal1 merged commit 38b8d24 into main Aug 6, 2025
17 checks passed
@2heal1 2heal1 deleted the fix/add-include-dev branch August 6, 2025 06:48
@2heal1 2heal1 mentioned this pull request Aug 6, 2025
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