diff --git a/.changeset/vite-plugin-remix.md b/.changeset/vite-plugin-remix.md new file mode 100644 index 000000000..be5b1fe4a --- /dev/null +++ b/.changeset/vite-plugin-remix.md @@ -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. diff --git a/packages/vite-plugin/src/index.ts b/packages/vite-plugin/src/index.ts index d739ea990..c618a7e7d 100644 --- a/packages/vite-plugin/src/index.ts +++ b/packages/vite-plugin/src/index.ts @@ -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', ), }); }