Skip to content

feat: restore static CSS extraction for production builds#71

Open
CharlesCoeder wants to merge 1 commit intotamagui:mainfrom
CharlesCoeder:feat/tamagui-static-css-extraction
Open

feat: restore static CSS extraction for production builds#71
CharlesCoeder wants to merge 1 commit intotamagui:mainfrom
CharlesCoeder:feat/tamagui-static-css-extraction

Conversation

@CharlesCoeder
Copy link
Copy Markdown

Summary

  • The withTamagui webpack plugin was removed from apps/next/next.config.js in 063c8b1 when the repo switched to Turbopack
  • This restores static CSS extraction using the Tamagui CLI (tamagui build), which works with Turbopack
  • Aligns with the recommended v2 approach per the Next.js guide — using the CLI for build-time optimization instead of the webpack plugin
  • Cleans up the now-unused DISABLE_EXTRACTION env var references from turbo.json and web:extract script

What changed

  • apps/next/tamagui.build.ts — new build config for the Tamagui CLI
  • apps/next/package.json — build script wraps next build with tamagui build --target web
  • apps/next/app/layout.tsx — imports the generated CSS
  • apps/next/public/tamagui.generated.css — generated static CSS (558 lines)
  • package.json — updated web:extract script to use the new approach
  • turbo.json — removed DISABLE_EXTRACTION from env lists

Results

  • 14/18 components optimized, 12 flattened to static CSS
  • Dev mode unchanged (Turbopack runtime, no extraction)
  • Production builds get static CSS extraction via the CLI pre-build step

… CLI

The withTamagui webpack plugin was removed during the Next 16/Turbopack migration.
This restores static CSS extraction using the Tamagui CLI approach, which wraps
the build command to optimize components and generate static CSS before Next.js
builds, then restores source files after. Dev mode remains unchanged (runtime only).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant