Skip to content

Commit

Permalink
fix(next-plugin): Next.js 13.5.x build not outputting css on windows (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
syfxlin committed Nov 9, 2023
1 parent 42bdf7a commit a22dd4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-cooks-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vanilla-extract/next-plugin': patch
---

Fixes Next.js 13.5.x CSS output on Windows when using React Server Components
5 changes: 2 additions & 3 deletions packages/next-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ export const createVanillaExtractPlugin = (
dir,
resolvedNextConfig.experimental?.appDir ?? false,
);
const hasAppDir =
!!resolvedNextConfig.experimental?.appDir &&
!!(findPagesDirResult && findPagesDirResult.appDir);
// Skip nextConfig check since appDir is stable feature after Next.js 13.4
const hasAppDir = !!(findPagesDirResult && findPagesDirResult.appDir);

const outputCss = hasAppDir
? // Always output css since Next.js App Router needs to collect Server CSS from React Server Components
Expand Down

0 comments on commit a22dd4d

Please sign in to comment.