Switch to @tailwindcss/vite + pin vite^7 to unbreak Docker build#1150
Switch to @tailwindcss/vite + pin vite^7 to unbreak Docker build#1150elemdos wants to merge 1 commit into
Conversation
Two bugs in vite 8 break the SvelteKit Docker build: 1. vite 8's bundled postcss-import can't resolve bare specifiers, so `@import 'tailwindcss';` errors with ENOENT for `/app/tailwindcss`. 2. vite 8 defaults cssMinify to lightningcss, which rejects @Keyframes inside Svelte's scoped CSS selectors. Use @tailwindcss/vite (canonical Tailwind v4 + Vite setup) so the Tailwind entry never touches vite's broken postcss-import. Pin vite to ^7.3.3 and vite-plugin-svelte to ^6.2.4 via npm overrides to dodge the lightningcss minify regression until upstream lands a fix.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis PR migrates Tailwind CSS configuration from a PostCSS-based setup to using the Tailwind Vite plugin. Dependencies are updated to use ChangesTailwind Vite Plugin Migration
🎯 1 (Trivial) | ⏱️ ~3 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Docker image build has been broken for ~11 days; CI's main.yml fails at
vite --config app.config.js build. Two vite 8 bugs are involved:<projectRoot>/tailwindcssas a literal path instead of resolving@import 'tailwindcss';from node_modules, producingENOENT: no such file or directory, open '/app/tailwindcss'.@keyframesblocks inside Svelte's nested-selector scoped CSS output.Dependabot exposed both by bumping
@sveltejs/kit2.59.1 → 2.60.1, which let the transitivevite-plugin-sveltere-resolve from 6.x → 7.1.2 and pull in vite 8.Fix
@tailwindcss/postcsswith@tailwindcss/vite(the canonical Tailwind v4 + Vite setup) so the Tailwind entry is resolved by Tailwind's own plugin and never touches vite's broken postcss-import.postcss.config.cjs(only contained the now-removed @tailwindcss/postcss entry; the postcss + postcss-nested deps are still used by runtime CSS workers, untouched).overridespinningvite ^7.3.3+@sveltejs/vite-plugin-svelte ^6.2.4to sidestep the lightningcss minify regression. Both are within@sveltejs/kit2.60.1's declared peer ranges.Verified locally:
npx vite --config app.config.js buildsucceeds, produces a ~230KB Tailwind CSS bundle plus Svelte component CSS chunks.Test plan
ghcr.io/primocms/primo:mainrebuilds and the testing deploy picks it upSummary by CodeRabbit