Skip to content
Source
Sign inSign up
TanStack/router

fix(start-plugin-core): skip the Rsbuild import-protection loader when disabled #8748

Mergedguru-irl(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/8748/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Showing 2 changed files with 8 additions and 0 deletions.

x
0 of 2 viewed, 2 left
5 additions and 0 deletions.changeset/skip-disabled-import-protection.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/start-plugin-core': patch
+---
+​
+Skip the Rsbuild import-protection loader and its plugins when import protection is disabled, so modules no longer pass through the loader.
3 additions and 0 deletionspackages/start-plugin-core/src/rsbuild/import-protection.tsModified
View file
@@ -1505,7 +1505,10 @@
applyUserConfig()
const envName = utils.environment.name
+ // When import protection is disabled, register nothing, as the Vite plugin
+ // does, so modules do not pass through the loader.
+ !config.enabled ||
!opts.environments.some((environment) => environment.name === envName)
return