Load a module default export from a JS/TS file with robust fallbacks.
Behavior by extension:
.js
.mjs
.cjs
.ts
.mts
.cts
.tsx
esbuild
typescript.transpileModule
Type of the expected default export.
Absolute path to the source file.
Cache subfolder under .tsbuild/.
.tsbuild/
A Promise\<T | undefined\> resolving to the default export (if any).
Promise\<T | undefined\>
Load a module default export from a JS/TS file with robust fallbacks.
Behavior by extension:
.js/.mjs/.cjs: direct dynamic import..ts/.mts/.cts/.tsx:esbuildto a cached.mjsfile and import,typescript.transpileModulefor simple modules.