Skip to content

✨ Add dev mode theme.json generation#36

Draft
retlehs wants to merge 1 commit into
mainfrom
dev-theme-json-generation
Draft

✨ Add dev mode theme.json generation#36
retlehs wants to merge 1 commit into
mainfrom
dev-theme-json-generation

Conversation

@retlehs

@retlehs retlehs commented Mar 12, 2026

Copy link
Copy Markdown
Member

Summary

  • Generate theme.json during vite dev so design token changes are immediately reflected in the WordPress block editor without a full build
  • Extract generateThemeJson() from generateBundle() so both build and dev paths share the same token extraction logic
  • On server start, call transformRequest() for the CSS entry so Tailwind tokens are available before the first browser request hits WordPress
  • Watch baseThemeJsonPath and tailwindConfig for changes, with live-reload of the Tailwind config
  • Debounced atomic writes (tmp + rename) to prevent PHP from reading half-written files
  • Unescape Vite's JS-wrapped CSS in dev mode so regex patterns can match variable declarations
  • Resolve outDir against Vite root so relative paths from laravel-vite-plugin work regardless of cwd

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@retlehs retlehs self-assigned this Mar 12, 2026
@retlehs retlehs marked this pull request as draft April 2, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant