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
Currently, the tsconfig option is only allowed for Build: https://esbuild.github.io/api/#tsconfig
However, I'm using vite which only allows esbuild transform (TransformOptions); tsconfig is not usable.
esbuild (through vite) currently defaults to our "IDE-only" tsconfig.json with stricter checks. As a result, we get lots of warnings and errors due to stricter checks than our code can satisfy.
What it should be using instead, is our more lax tsconfig.build.json (which our code does satisfy).
This is also the original problem from #226 which was solved by adding tsconfig to the Build options in 9ac27fa
For that, I'd like to have this in our vite config:
While commonOptions allows tsconfigRaw, it does not allow tsconfig.
For vite, there's also a discussion about specifying the tsconfig.json, and this is a suggested workaround: vitejs/vite#10531 (comment)
That basically loads tsconfig.json and plugs it into the tsconfigRaw.
I assume that esbuild still loads the actual "tsconfig.json" (which shouldn't be necessary) and then overwrites (or even merges?) the tsconfigRaw, which might lead to unexpected results.
The text was updated successfully, but these errors were encountered:
The only way to pass tsconfig.json to the transform API is with tsconfigRaw: https://esbuild.github.io/api/#tsconfig-raw. The transform API is intended to be used without a file system, so it doesn’t make sense to pass it a file system path.
If you want esbuild to search the file system when building (for at least both tsconfig.json and package.json), you can use the build API instead.
ghost
changed the title
tsconfig option only allowd for Build, but not for Transformtsconfig option only allowed for Build, but not for Transform
Jun 16, 2023
Currently, the
tsconfig
option is only allowed for Build: https://esbuild.github.io/api/#tsconfigHowever, I'm using vite which only allows esbuild transform (
TransformOptions
);tsconfig
is not usable.esbuild (through vite) currently defaults to our "IDE-only" tsconfig.json with stricter checks. As a result, we get lots of warnings and errors due to stricter checks than our code can satisfy.
What it should be using instead, is our more lax
tsconfig.build.json
(which our code does satisfy).This is also the original problem from #226 which was solved by adding
tsconfig
to the Build options in 9ac27faFor that, I'd like to have this in our vite config:
However, that's not allowed, because
esbuild
:esbuild?: ESBuildOptions | false;
..interface ESBuildOptions extends EsbuildTransformOptions
..import { TransformOptions as EsbuildTransformOptions } from 'esbuild';
which is..esbuild/lib/shared/types.ts
Lines 255 to 264 in 73ee85a
While
commonOptions
allowstsconfigRaw
, it does not allowtsconfig
.For vite, there's also a discussion about specifying the tsconfig.json, and this is a suggested workaround: vitejs/vite#10531 (comment)
That basically loads
tsconfig.json
and plugs it into thetsconfigRaw
.I assume that esbuild still loads the actual "tsconfig.json" (which shouldn't be necessary) and then overwrites (or even merges?) the
tsconfigRaw
, which might lead to unexpected results.The text was updated successfully, but these errors were encountered: