fix: restore vite-tsconfig-paths for baseUrl resolution#11917
Merged
Conversation
This is an attempt to fix the Enterprise build issue due to to theme/app.css not being found. Claude suggests that it may be related to Vite 8's built-in `resolve.tsconfigPaths: true` not handling baseUrl-relative resolution reliably. Claude's summary: Vite 8's built-in `resolve.tsconfigPaths: true` only handles `paths` mappings reliably; baseUrl-relative resolution is fragile in some environments (we hit it in enterprise's pnpm-driven prepack of OSS, where `themes/app.css` and similar bare imports failed to resolve). The pre-Vite-8 `vite-tsconfig-paths` plugin handled both. Re-add it with the same plugin position as before, and drop the built-in flag to avoid two resolvers disagreeing on edge cases. Drop the plugin again once the built-in handler matures.
Contributor
Dependency ReviewThe following issues were found:
OpenSSF Scorecard
Scanned Files
|
Contributor
There was a problem hiding this comment.
Pull request overview
Restores the frontend’s explicit tsconfig path-resolution plugin so Vite resolves baseUrl imports the same way it did before the Vite 8 migration. In this codebase, that mainly supports frontend source imports like themes/* and component/* during build/prepack flows.
Changes:
- Re-add
vite-tsconfig-pathsto the frontend devDependencies and lockfile. - Remove Vite 8’s built-in
resolve.tsconfigPaths: truesetting from the frontend config. - Register the external
tsconfigPaths()plugin infrontend/vite.config.mts.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
frontend/yarn.lock |
Locks the newly restored vite-tsconfig-paths dependency and its transitive packages. |
frontend/vite.config.mts |
Switches frontend path resolution back from Vite’s built-in flag to the explicit plugin. |
frontend/package.json |
Declares vite-tsconfig-paths as a frontend dev dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an attempt to fix the Enterprise build issue due to to theme/app.css not being found. Claude suggests that it may be related to Vite 8's built-in
resolve.tsconfigPaths: truenot handling baseUrl-relative resolution reliably.I'm not positive that this will fix it, but it's a small change and it goes back to the way we did it before vite8, so it seems worth trying. It's hard to replicate locally, so this is probably the quickest way to validate it. For reference, the handling was updated in #11766.
Running the front end with this plugin makes vite emit this:
However, there may still be some issues left to fix (e.g. vitejs/vite#21856 ; upstream PR to fix it oxc-project/oxc-resolver#1080)
Claude's summary:
Vite 8's built-in
resolve.tsconfigPaths: trueonly handlespathsmappings reliably; baseUrl-relative resolution is fragile in some environments (we hit it in enterprise's pnpm-driven prepack of OSS, wherethemes/app.cssand similar bare imports failed to resolve).The pre-Vite-8
vite-tsconfig-pathsplugin handled both. Re-add it with the same plugin position as before, and drop the built-in flag to avoid two resolvers disagreeing on edge cases. Drop the plugin again once the built-in handler matures.