Skip to content

Commit

Permalink
fix(core): check compilerOptions exists before deleting it (#20648)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored Dec 7, 2023
1 parent a5a4211 commit 01d7c82
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/nx/src/hasher/native-task-hasher-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ import { Task, TaskGraph } from '../config/task-graph';
import {
ExternalObject,
FileData,
HashPlanner,
HasherOptions,
HashPlanner,
NxWorkspaceFilesExternals,
ProjectGraph as NativeProjectGraph,
transferProjectGraph,
TaskHasher,
NxWorkspaceFilesExternals,
transferProjectGraph,
} from '../native';
import { transformProjectGraphForRust } from '../native/transform-objects';
import { PartialHash, TaskHasherImpl } from './task-hasher';
import { readJson } from '../generators/utils/json';
import { readJsonFile } from '../utils/fileutils';
import { getRootTsConfigPath } from '../plugins/js/utils/typescript';

Expand Down Expand Up @@ -46,7 +45,9 @@ export class NativeTaskHasherImpl implements TaskHasherImpl {
if (rootTsConfigPath) {
tsconfig = readJsonFile(getRootTsConfigPath());
paths = tsconfig.compilerOptions?.paths ?? {};
delete tsconfig.compilerOptions.paths;
if (tsconfig.compilerOptions?.paths) {
delete tsconfig.compilerOptions.paths;
}
}

this.planner = new HashPlanner(nxJson, this.projectGraphRef);
Expand Down

0 comments on commit 01d7c82

Please sign in to comment.