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
NodeJS recently introduced the new --experimental-strip-types and --experimental-transform-types flags, allowing to .ts files without the need to transpile anything (types are just replaced with 1 empty space).
Is it possible to give the developer the option to opt-out of the build-in typescript transpiling when running vitest?
I see unconsistent behaviours arising with imports (probably due to esnext/tsx way of handling cjs).
This feature is probably close to #3995 in the spirit. If having an genuine and more strict node behavior is critical, we have to recommend node test runner for now.
I see unconsistent behaviours arising with imports (probably due to esnext/tsx way of handling cjs).
This is more of resolution difference than transpilation and that's probably a harder part for Vite/Vitest to not intervene.
You can technically disable esbuild transpilation by esbuild: falsehttps://vite.dev/config/shared-options.html#esbuild, but that's not enough since internally Vite expects transpiled js, so it would simply breaks.
Vite is what makes Vitest - Vitest, so the user code will always be processed by Vite. If you wish to support TS in external packages, you can pass down --experimental-strip-types in execArgv: https://vitest.dev/config/#pooloptions-forks-execargv
Clear and concise description of the problem
NodeJS recently introduced the new
--experimental-strip-types
and--experimental-transform-types
flags, allowing to.ts
files without the need to transpile anything (types are just replaced with 1 empty space).Full repro here: https://github.com/damianobarbati/ts-repro/
Is it possible to give the developer the option to opt-out of the build-in typescript transpiling when running vitest?
I see unconsistent behaviours arising with imports (probably due to esnext/tsx way of handling cjs).
Suggested solution
Give a flag to opt-out of transpiling.
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: