Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changeset/little-cups-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-router/dev": patch
---

When executing `react-router.config.ts` and `routes.ts` with `vite-node`, ensure that PostCSS config files are ignored
9 changes: 9 additions & 0 deletions packages/react-router-dev/vite/vite-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ export async function createContext({
optimizeDeps: {
noDiscovery: true,
},
css: {
// This empty PostCSS config object prevents the PostCSS config file from
// being loaded. We don't need it in a React Router config context, and
// there's also an issue in Vite 5 when using a .ts PostCSS config file in
// an ESM project: https://github.com/vitejs/vite/issues/15869. Consumers
// can work around this in their own Vite config file, but they can't
// configure this internal usage of vite-node.
postcss: {},
},
configFile: false,
envFile: false,
plugins: [],
Expand Down