feat: launch dsh source with native TypeScript

This commit is contained in:
imccyu
2026-07-28 23:05:20 +08:00
parent 5ea161fa68
commit db3b12a0f7
7 changed files with 274 additions and 42 deletions

14
scripts/tspath-loader.ts Normal file
View File

@@ -0,0 +1,14 @@
/** Register source-only tsconfig paths resolution before a TypeScript entry loads. */
import { register } from 'node:module'
import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
const tsconfigPath = process.env.TSX_TSCONFIG_PATH === undefined
? fileURLToPath(new URL('../tsconfig.json', import.meta.url))
: resolve(process.env.TSX_TSCONFIG_PATH)
register(new URL('../apps/cli/src/tsconfig-paths-loader.ts', import.meta.url), {
parentURL: import.meta.url,
data: { tsconfigPath },
})