You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Until now I was using this technique to inject the contents of the file and enable the resolution of the paths, but now tsconfigRaw is no longer available.
Vite 8 should make tsconfig handling more automatic for example with builtin paths support through resolve.tsconfigPaths#10054, but not sure how esbuild.tsconfigRaw can be migrated. Probably it's better asked on https://github.com/vitejs/vite/issues.
Related vitejs/vite#22112
The discussion on supporting non default tsconfig.json is happening there. Please comment on that issue with concrete use case to help the decision.
@rubnogueira Can you provide actual contents of what configuration you switch between prod and dev? You still haven't provided the actual use case and motivations.
For example, esbuild. tsconfigRaw is for transform ts files and it would help what you intend to transform differently. Then tsconfigPaths for swapping relevant paths for two cases. We are interested to know how this split is effective in practice.
For our use case we have two different tsconfig.json, for example: tsconfig.json and tsconfig.prod.json that is used in our CI pipeline.
tsconfig.prod.json extends tsconfig.json and overrides 3 properties:
composite => true => false
paths => multiple @company/* to empty {}
references => multiple @company/* to [].
We have a monorepo where some "packages" are git submodules. For those packages that are git submodules, instead of us using the workspace * reference in the package.json, we use the published registry lets say 1.2.345 because they are not truly in the context of the workspace. So as part of the DX, we override the project references/paths to behave like a true monorepo, while in our CI we restore the original behavior.
Those git submodules have their CI and imagine them like subcontracted packages, where they make sense in the codebase but they don't 100% belong to the codebase.
With the vite esbuild config, we can use the tsconfigRaw and simply include the contents of tsconfig.prod.json there, and with tsconfigPaths we change the "path" of that tsconfig.
I'm happy to follow an alternative path if I manage to override those properties.
@rubnogueira Thanks for the follow up. Looking at the three properties you override in tsconfig.prod.json (composite, references, paths), none of them actually affect the typescript transform that esbuild.tsconfigRaw controls. So it's possible that esbuild.tsconfigRaw customization isn't necessary.
Could you confirm if you drop esbuild.tsconfigRaw entirely and only switch tsconfigPaths between tsconfig.json / tsconfig.prod.json, does everything still work? If something does break without tsconfigRaw, please share that specific failure that would point to a real transform-level need and help justify the upstream changes.
Unfortunately I don't have a chance/time right now to test it, but I will test it asap and potentially create a repro of that structure and I will report back. Thank you!
From what I understand from #10176 (comment), I guess setting resolve.tsconfigPaths: isDev (assuming isDev is true for dev and false for build) would work.
Activity
hi-ogawa commentedon Apr 23, 2026
Vite 8 should make tsconfig handling more automatic for example with builtin
pathssupport throughresolve.tsconfigPaths#10054, but not sure howesbuild.tsconfigRawcan be migrated. Probably it's better asked on https://github.com/vitejs/vite/issues.hi-ogawa commentedon Apr 23, 2026
Related vitejs/vite#22112
The discussion on supporting non default
tsconfig.jsonis happening there. Please comment on that issue with concrete use case to help the decision.rubnogueira commentedon May 26, 2026
@hi-ogawa
I implemented the proper fixes here:
vitejs/vite#22533
rolldown/rolldown#9571
hi-ogawa commentedon Jun 24, 2026
@rubnogueira Can you provide actual contents of what configuration you switch between prod and dev? You still haven't provided the actual use case and motivations.
For example,
esbuild. tsconfigRawis for transform ts files and it would help what you intend to transform differently. ThentsconfigPathsfor swapping relevantpathsfor two cases. We are interested to know how this split is effective in practice.rubnogueira commentedon Jun 24, 2026
For our use case we have two different
tsconfig.json, for example:tsconfig.jsonandtsconfig.prod.jsonthat is used in our CI pipeline.tsconfig.prod.jsonextendstsconfig.jsonand overrides 3 properties:@company/*to empty{}@company/*to[].We have a monorepo where some "packages" are git submodules. For those packages that are git submodules, instead of us using the workspace * reference in the package.json, we use the published registry lets say 1.2.345 because they are not truly in the context of the workspace. So as part of the DX, we override the project references/paths to behave like a true monorepo, while in our CI we restore the original behavior.
Those git submodules have their CI and imagine them like subcontracted packages, where they make sense in the codebase but they don't 100% belong to the codebase.
With the vite esbuild config, we can use the
tsconfigRawand simply include the contents oftsconfig.prod.jsonthere, and withtsconfigPathswe change the "path" of thattsconfig.I'm happy to follow an alternative path if I manage to override those properties.
hi-ogawa commentedon Jun 24, 2026
@rubnogueira Thanks for the follow up. Looking at the three properties you override in
tsconfig.prod.json(composite,references,paths), none of them actually affect the typescript transform thatesbuild.tsconfigRawcontrols. So it's possible thatesbuild.tsconfigRawcustomization isn't necessary.Could you confirm if you drop
esbuild.tsconfigRawentirely and only switchtsconfigPathsbetweentsconfig.json/tsconfig.prod.json, does everything still work? If something does break withouttsconfigRaw, please share that specific failure that would point to a real transform-level need and help justify the upstream changes.rubnogueira commentedon Jun 24, 2026
Unfortunately I don't have a chance/time right now to test it, but I will test it asap and potentially create a repro of that structure and I will report back. Thank you!
sapphi-red commentedon Jul 21, 2026
From what I understand from #10176 (comment), I guess setting
resolve.tsconfigPaths: isDev(assumingisDevis true for dev and false for build) would work.sapphi-red commentedon Sep 29, 2026
vitejs/vite#23310 is released in Vite 8.3 so this is probably solved