Replies: 3 comments
-
https://www.npmjs.com/package/tsconfig-paths also doesn't seem to help with this |
Beta Was this translation helpful? Give feedback.
-
Have you tested how Something like this:
Whatever output you receive as output, be sure to interpret it and determine what it means. Some errors may indicate success. |
Beta Was this translation helpful? Give feedback.
-
I get the impression that node/ts/etc. aren't really supported without packages.json tsconfig.json and node_modules/ everywhere (reasons below). Is this a fair statement? Is there any real intention to improve the situation? It's a bit sad since ts-node has been downloaded 87M times or so and at least some of those must be interested in shebang like old times but maybe this space is just left for python still. Reasons:
Well I couldn't reproduce the behavior I thought I was seeing. I've tried pretty hard now but can't get ts-node to behave reasonably without packages.json and node_modules/.
|
Beta Was this translation helpful? Give feedback.
-
I wanted to set up my own dialect of ts to be used by default for free scripts (no tsconfig.json etc.), ts-node looks good, so:
#!/usr/bin/env -S ts-node --esm --pretty --project="${HOME}/.my.tsconfig.json"
where
~/.my.tsconfig.json
specifies my dialect.One thing I've run into is that it doesn't seem to resolve some things especially where tsc is involved, for example with
"extends": "@tsconfig/node18-strictest-esm/tsconfig.json",
in ~/.my.tsconfig.json I get an error:
replacing the link with the full path the that tsconfig.json works.
Is there some option that can be passed through to tsc to make this work (and improve module resolution generally)?
I tried
--compilerOptions "{\"baseUrl\": \"${NODE_PATH}\"}"
but still got the same error. I notice giving a bogus compiler option name (e.g. baaaaseUrl) still gives the same error so it doesn't seem like this option is making to the compiler at all,do I have it wrong somehow?
I get the impression from this discussion that maybe environmental ts just isn't really done yet generally:
#1450
Beta Was this translation helpful? Give feedback.
All reactions