Open tommy-mitchell opened 1 year ago
Sorry for posting in the other issue, thought it'd be relevant because they were both about the paths
option :) my bad.
Maybe this has to do with how @esbuild-kit/esm-loader
loads tsconfig.json
? At a glance, it looks like it's only loaded once per project: https://github.com/esbuild-kit/esm-loader/blob/13ce0ca4978635618bc65bc94f3c8f92131d45c1/src/utils.ts#L13-L23
@privatenumber,
Could you explain why, when I place a custom configuration file in the directory with the executable script, it is not being picked up? In my project, there is a global tsconfig.json file where the target is set to es5, but my script requires es2017. I added a custom configuration file in the script's directory and specified its path in tsconfig.json. It feels like the tsx configuration does not recognize this file and continues to refer to the global one.
Why not simply add the ability to override options from the global configuration, for example, using something like --target=es2017
?
Looks not good:
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"target": "es2017",
"paths": {
"@/*": [
"../../../src/*"
]
}
}
}
@tommy-mitchell In the case within the reproduction tsx-repro pointing directly to the tsconfig assists e.g.
"start": "tsx --tsconfig ./test/tsconfig.json test/test.ts"
May give some milage for similar path resolution issue.
Bug description
My project has separate
tsconfig.json
files for source and test files. When setting up thepaths
compiler option, my IntelliSense correctly provides type information for imports, buttsx
fails with theERR_MODULE_NOT_FOUND
error.Reproduction
https://github.com/tommy-mitchell/tsx-repro
Environment
Can you work on a fix?