Skip to content

Commit

Permalink
feat(core): rename environment variable to NX_PREFER_TS_NODE
Browse files Browse the repository at this point in the history
  • Loading branch information
yharaskrik committed Apr 3, 2023
1 parent 262d329 commit bb73ada
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/shared/reference/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The following environment variables are ones that you can set to change the behavior of Nx in different environments.

| Property | Type | Description |
| -------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|----------------------------------| ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| NX_BASE | string | The default base branch to use when calculating the affected projects. Can be overridden on the command line with `--base`. |
| NX_CACHE_DIRECTORY | string | The cache for task outputs is stored in `node_modules/.cache/nx` by default. Set this variable to use a different directory. |
| NX_CACHE_PROJECT_GRAPH | boolean | If set to `false`, disables the project graph cache. Most useful when developing a plugin that modifies the project graph. |
Expand All @@ -21,6 +21,7 @@ The following environment variables are ones that you can set to change the beha
| NX_DRY_RUN | boolean | If set to `true`, will perform a dry run of the generator. No files will be created and no packages will be installed. |
| NX_INTERACTIVE | boolean | If set to `true`, will allow Nx to prompt you in the terminal to answer some further questions when running generators. |
| NX_GENERATE_QUIET | boolean | If set to `true`, will prevent Nx logging file operations during generate |
| NX_PREFER_TS_NODE | boolean | If set to `true`, Nx will use ts-node for local execution of plugins even if `@swc-node/register` is installed. |

Nx will set the following environment variables so they can be accessible within the process even outside of executors and generators

Expand Down
2 changes: 1 addition & 1 deletion packages/nx/src/utils/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function registerTranspiler(
// Function to register transpiler that returns cleanup function
let registerTranspiler: () => () => void;

const preferTsNode = process.env.NX_TS_NODE_LOCAL_EXECUTION === 'true';
const preferTsNode = process.env.NX_PREFER_TS_NODE === 'true';

if (swcNodeInstalled && !preferTsNode) {
// These are requires to prevent it from registering when it shouldn't
Expand Down

0 comments on commit bb73ada

Please sign in to comment.