Skip to content

Commit 20e33a5

Browse files
authored
Don't pass Remix Vite plugin to the vite-node compiler (#1308)
1 parent c6bb6d7 commit 20e33a5

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.changeset/vite-plugin-remix.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@vanilla-extract/vite-plugin': patch
3+
---
4+
5+
Don't pass Remix Vite plugin to the vite-node compiler
6+
7+
Remix throws an error if it's loaded without a config file, which is what we do when we initialise the vite-node compiler.

packages/vite-plugin/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,13 @@ export function vanillaExtractPlugin({
125125
plugin !== null &&
126126
'name' in plugin &&
127127
// Prevent an infinite loop where the compiler creates a new instance of the plugin,
128-
// which creates a new compiler, which creates a new instance of the plugin, etc.
128+
// which creates a new compiler, which creates a new instance of the plugin, etc.
129129
plugin.name !== 'vanilla-extract' &&
130130
// Skip Vitest plugins
131131
plugin.name !== 'vitest' &&
132-
!plugin.name.startsWith('vitest:'),
132+
!plugin.name.startsWith('vitest:') &&
133+
// Skip Remix because it throws an error if it's not loaded with a config file
134+
plugin.name !== 'remix',
133135
),
134136
});
135137
}

0 commit comments

Comments
 (0)