fix(vite): resolve tsconfig paths in CSS and JS resolvers#19803
fix(vite): resolve tsconfig paths in CSS and JS resolvers#19803nightah wants to merge 2 commits intotailwindlabs:mainfrom
Conversation
Change `aliasOnly` from `true` to `false` when calling Vite's resolver so that the full resolution pipeline runs, including the oxc resolver responsible for tsconfig path resolution. When `aliasOnly` was `true`, only the @rollup/plugin-alias plugin ran, which meant `resolve.tsconfigPaths: true` had no effect on CSS `@import` or JS `@plugin` resolution in `@tailwindcss/vite`. Closes tailwindlabs#19802
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe pull request adds an import for 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
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 Tip CodeRabbit can generate a title for your PR based on the changes.Add |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
integrations/vite/resolvers.test.ts (1)
15-165: Optional: extract shared fixture setup to reduce duplication.Both new tests repeat the same filesystem fixture; extracting a small helper/object for shared files would make future resolver test updates less error-prone.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@integrations/vite/resolvers.test.ts` around lines 15 - 165, Extract the duplicated filesystem fixture used in the two tests titled "resolves tsconfig paths in production build" and "resolves tsconfig paths in dev mode" into a shared constant (e.g., sharedFs) and reference that constant in each test's options instead of duplicating the object; update the tests to pass the sharedFs to the test helper (replace the inline fs: { ... } blocks with fs: sharedFs) so future changes to the fixture live in one place and both tests (production build and dev mode) reuse the same setup.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@integrations/vite/resolvers.test.ts`:
- Around line 15-165: Extract the duplicated filesystem fixture used in the two
tests titled "resolves tsconfig paths in production build" and "resolves
tsconfig paths in dev mode" into a shared constant (e.g., sharedFs) and
reference that constant in each test's options instead of duplicating the
object; update the tests to pass the sharedFs to the test helper (replace the
inline fs: { ... } blocks with fs: sharedFs) so future changes to the fixture
live in one place and both tests (production build and dev mode) reuse the same
setup.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: a1c6b6ce-a66b-41d5-a9dd-78be04245a20
📒 Files selected for processing (2)
integrations/vite/resolvers.test.tspackages/@tailwindcss-vite/src/index.ts
|
Hey! Looks like CI is failing. Do you mind making sure that things work as expected? Thanks! |
|
Thanks for the ping @RobinMalfait. I believe this is now fixed. When That said, I'm unsure whether the remaining test failures are related to my change or an environmental issue.
|
Change
aliasOnlyfromtruetofalsewhen calling Vite's resolver so that the full resolution pipeline runs, including the oxc resolver responsible for tsconfig path resolution.When
aliasOnlywastrue, only the @rollup/plugin-alias plugin ran, which meantresolve.tsconfigPaths: truehad no effect on CSS@importor JS@pluginresolution in@tailwindcss/vite.Closes #19802.