Repository navigation
fix: resolve string template CSS imports from config.root - #1916
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughTailwind transformers now use ChangesTailwind import resolution
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to String templates rendered with a configured root should now resolve Tailwind CSS imports from that root. Callers without a root keep the existing behavior. No merge-blocking risk was identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
Fixes #1914
When
render()gets an SFC string instead of a file path, the Tailwind transformers compiled its CSS withfromset toprocess.cwd()/template.vue, ignoringconfig.root. Servers whose working directory can't resolve@maizzle/tailwindcss(e.g. a Nitro build started from/app) failed withCan't resolve '@maizzle/tailwindcss'and returned the email unstyled.Changes
tailwindcssandtailwindComponenttransformers now fall back toconfig.root ?? process.cwd(), same as the linter and compatibility checker. No change for callers that don't passrootresolveMaizzleImportsnow runs inOnceinstead of as anAtRulevisitor. PostCSS runs every plugin'sOncebefore any visitor, and@tailwindcss/postcssresolves imports in its ownOnce, so the rewrite to an absolute path always came too late. It also getsconfig.rootnow instead of defaulting to cwd@maizzle/tailwindcssresolves even when neither cwd norrootcan, by falling back to the copy bundled with the frameworkTests
tailwindcsswithout a filePath, from a cwd that can't resolve anything: relative imports resolve fromconfig.root, and@maizzle/tailwindcssresolves even whenrootcan'ttailwindComponent: relative imports resolve fromconfig.rootresolveMaizzleImports: the rewrite is visible to a later plugin'sOncehook🤖 Generated with Claude Code
Summary by CodeRabbit