Skip to content

Commit

Permalink
Don't pass Remix Vite plugin to the vite-node compiler (#1308)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrm007 committed Feb 4, 2024
1 parent dbf178d commit 2422470
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/vite-plugin-remix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@vanilla-extract/vite-plugin': patch
---

Don't pass Remix Vite plugin to the vite-node compiler

Remix throws an error if it's loaded without a config file, which is what we do when we initialise the vite-node compiler.
6 changes: 4 additions & 2 deletions packages/vite-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,13 @@ export function vanillaExtractPlugin({
plugin !== null &&
'name' in plugin &&
// Prevent an infinite loop where the compiler creates a new instance of the plugin,
// which creates a new compiler, which creates a new instance of the plugin, etc.
// which creates a new compiler, which creates a new instance of the plugin, etc.
plugin.name !== 'vanilla-extract' &&
// Skip Vitest plugins
plugin.name !== 'vitest' &&
!plugin.name.startsWith('vitest:'),
!plugin.name.startsWith('vitest:') &&
// Skip Remix because it throws an error if it's not loaded with a config file
plugin.name !== 'remix',
),
});
}
Expand Down

0 comments on commit 2422470

Please sign in to comment.