Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, like we do when we initialise the vite-node compiler.
mrm007 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading