-
-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shebang support #73
Comments
@nevir Works for me, what's your issue? |
Closing as it appears to work. |
This doesn't seem to work when the file is without an extension for whatever reason. Thoughts? |
It works but you will need the |
Also if you don't want to install ts-node globally:
|
without the ts extension, I assume you could do something like
|
A bit more complete version of @ORESoftware's example above: #!/usr/bin/env bash
/usr/bin/env ts-node whatever.ts "$@"
|
What's the best way to add the project flag to the shebang? |
Pretty sure it's in the readme. I'm on mobile at the moment.
…On Sun, Jun 28, 2020, 5:10 PM Troy ***@***.***> wrote:
What's the best way to add the project flag to the shebang?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#73 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC35OHP7F47FC3T37FSA3LRY6WWFANCNFSM4B5ZUA3A>
.
|
Ahh. I see. I need to use ts-node-script. So in an Nx project, if I'm making a publishable lib, it creates 2-3 tsconfig files. Obviously, when it is published node would run the CLI, but for testing purposes, I was thinking it would be nice to run it with ts-node from inside the same mono-repo... It might not pick up the tsconfig.lib.json, but it should pick up the tsconfig.json and if that isn't good enough, I can probably just build it before using it in mono-repo. |
Yeah, we also let you override some "compilerOptions" within a tsconfig's
`"ts-node": {}` object. So you can tell the compiler to behave differently
in ts-node if needed. I think this is in the readme too, but if you find
the readme is insufficient, feel free to file a ticket so we can improve it.
…On Sun, Jun 28, 2020, 5:33 PM Troy ***@***.***> wrote:
Ahh. I see. I need to use ts-node-script. So in an Nx project, if I'm
making a publishable lib, it creates 2-3 tsconfig files. Obviously, when it
is published node would run the CLI, but for testing purposes, I was
thinking it would be nice to run it with ts-node from inside the same
mono-repo... It might not pick up the tsconfig.lib.json, but it sounds pick
up the tsconfig.json and if that isn't good enough, I can probably just
build it before using it in mono-repo.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#73 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC35OHUSAKJ3HZMESZLU63RY6ZJZANCNFSM4B5ZUA3A>
.
|
another one
#!/usr/bin/env -S TS_NODE_PROJECT="src/tsconfig.json" npx ts-node --transpile-only --files -r tsconfig-paths/register
const foo: string = 'bar'
console.log(foo) |
You can also move the
If the script is already within the |
I had luck with
thereafter
|
Would be awesome to be able to use
ts-node
as a shebang script:The text was updated successfully, but these errors were encountered: