Skip to content
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

TS_NODE_OPTIONS #476

Closed

Conversation

stelcheck
Copy link
Contributor

@stelcheck stelcheck commented Dec 10, 2017

This will remap all TS_NODE_ environment to
NODE_ environment variables for the child process
being spawned.

Fixes #471

@coveralls
Copy link

coveralls commented Dec 10, 2017

Coverage Status

Coverage remained the same at 76.633% when pulling df3c05b on stelcheck:features/ts-node-options into d4a1c94 on TypeStrong:master.

This will remap all `TS_NODE_` environment to
`NODE_` environment variables for the child process
being spawned.

Fixes TypeStrong#471
@stelcheck stelcheck changed the title Support trace-warnings flag, TS_NODE_OPTIONS TS_NODE_OPTIONS Dec 15, 2017
@stelcheck
Copy link
Contributor Author

@blakeembrey updated this PR to externalize flag additions, and resolved merge conflict.

@coveralls
Copy link

coveralls commented Dec 15, 2017

Coverage Status

Coverage remained the same at 77.427% when pulling f68e6e3 on stelcheck:features/ts-node-options into 1541dfe on TypeStrong:master.

@ORESoftware
Copy link

oh shabam lookin' good

stelcheck added a commit to stelcheck/ts-node that referenced this pull request Dec 20, 2017
This commit:

  1. Cleans up how the code is loaded
  2. Removes the necessity to use 'spawn'

Replaces TypeStrong#476
Replaces TypeStrong#489
@stelcheck stelcheck mentioned this pull request Dec 20, 2017
@blakeembrey
Copy link
Member

Closing with #536 since I decided to kill the subprocess behaviour.

@dPowNextdoor
Copy link

Can we actually re-open this? In light of #1007, --experimental-specifier-resolution=node doesn't seem to work with ts-node very well, if at all. It would solve this (as well as any other problems that may arise from future NodeJS experimental features) if we could simply use a TS_NODE_OPTIONS in our .npmrc files to override the node-options used for non-ts-node commands.

D-Pow added a commit to D-Pow/react-app-boilerplate that referenced this pull request Jan 12, 2022
This allows `ts-node` to be used to run TypeScript files without having to compile them with `tsc` first. It also adds the necessary configs, including `tsconfig-paths` for `paths` import-alias resolution. Unfortunately, this means we have to remove the `--experimental-module-resolution=node` since `ts-node` uses its own loader and thus form of resolving modules.

See:

Setup
* https://medium.com/@jimcraft123hd/setting-up-path-alias-in-typescript-and-tsc-build-without-error-9f1dbc0bccd2

Issues with `ts-node`, ESM, and aliases
* TypeStrong/ts-node#1007
    - TypeStrong/ts-node#476
    - dividab/tsconfig-paths#122 (comment)
    - TypeStrong/ts-node#1450 (comment)
* TypeStrong/ts-node#1414
* TypeStrong/ts-node#995
    - TypeStrong/ts-node#639

Node issues with ESM
* https://nodejs.org/api/packages.html#determining-module-system
* nodejs/node#37468
D-Pow added a commit to D-Pow/react-app-boilerplate that referenced this pull request Jan 12, 2022
This allows `ts-node` to be used to run TypeScript files without having to compile them with `tsc` first. It also adds the necessary configs, including `tsconfig-paths` for `paths` import-alias resolution. Unfortunately, this means we have to remove the `--experimental-module-resolution=node` since `ts-node` uses its own loader and thus form of resolving modules.

See:

Setup
* https://medium.com/@jimcraft123hd/setting-up-path-alias-in-typescript-and-tsc-build-without-error-9f1dbc0bccd2

Issues with `ts-node`, ESM, and aliases
* TypeStrong/ts-node#1007
    - TypeStrong/ts-node#476
    - dividab/tsconfig-paths#122 (comment)
    - TypeStrong/ts-node#1450 (comment)
* TypeStrong/ts-node#1414
* TypeStrong/ts-node#995
    - TypeStrong/ts-node#639

Node issues with ESM
* https://nodejs.org/api/packages.html#determining-module-system
* nodejs/node#37468
D-Pow added a commit to D-Pow/react-app-boilerplate that referenced this pull request Jan 12, 2022
This allows `ts-node` to be used to run TypeScript files without having to compile them with `tsc` first. It also adds the necessary configs, including `tsconfig-paths` for `paths` import-alias resolution. Unfortunately, this means we have to remove the `--experimental-module-resolution=node` since `ts-node` uses its own loader and thus form of resolving modules.

See:

Setup
* https://medium.com/@jimcraft123hd/setting-up-path-alias-in-typescript-and-tsc-build-without-error-9f1dbc0bccd2

Issues with `ts-node`, ESM, and aliases
* TypeStrong/ts-node#1007
    - TypeStrong/ts-node#476
    - dividab/tsconfig-paths#122 (comment)
    - TypeStrong/ts-node#1450 (comment)
* TypeStrong/ts-node#1414
* TypeStrong/ts-node#995
    - TypeStrong/ts-node#639

Node issues with ESM
* https://nodejs.org/api/packages.html#determining-module-system
* nodejs/node#37468
@cspotcode
Copy link
Collaborator

@dPowNextdoor --experimental-specifier-resolution is a node option, not a ts-node option, so you can already specify that option via NODE_OPTIONS. It is compatible with ts-node; we have automated tests to ensure this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants