Skip to content

Commit

Permalink
fix(vite-plugin): Omit React-Router v7 plugin for DevServer (#1492)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Skoufis <[email protected]>
  • Loading branch information
kube and askoufis authored Oct 24, 2024
1 parent 284098c commit 1fd348a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/vite-plugin-react-router.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vanilla-extract/vite-plugin': patch
---

Filter out `react-router` Vite plugin when creating the `vite-node` compiler
4 changes: 3 additions & 1 deletion packages/vite-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ const removeIncompatiblePlugins = (plugin: PluginOption) =>
// Additionally, some internal Remix plugins rely on a `ctx` object to be initialized by
// the main Remix plugin, and may not function correctly without it. To address this, we
// filter out all Remix-related plugins.
!plugin.name.startsWith('remix');
!plugin.name.startsWith('remix') &&
// As React-Router plugin works the same as Remix plugin, also ignore it.
!plugin.name.startsWith('react-router');

interface Options {
identifiers?: IdentifierOption;
Expand Down

0 comments on commit 1fd348a

Please sign in to comment.