Skip to content

Commit 1fd348a

Browse files
kubeaskoufis
andauthored
fix(vite-plugin): Omit React-Router v7 plugin for DevServer (#1492)
Co-authored-by: Adam Skoufis <[email protected]>
1 parent 284098c commit 1fd348a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@vanilla-extract/vite-plugin': patch
3+
---
4+
5+
Filter out `react-router` Vite plugin when creating the `vite-node` compiler

packages/vite-plugin/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ const removeIncompatiblePlugins = (plugin: PluginOption) =>
4040
// Additionally, some internal Remix plugins rely on a `ctx` object to be initialized by
4141
// the main Remix plugin, and may not function correctly without it. To address this, we
4242
// filter out all Remix-related plugins.
43-
!plugin.name.startsWith('remix');
43+
!plugin.name.startsWith('remix') &&
44+
// As React-Router plugin works the same as Remix plugin, also ignore it.
45+
!plugin.name.startsWith('react-router');
4446

4547
interface Options {
4648
identifiers?: IdentifierOption;

0 commit comments

Comments
 (0)