diff --git a/packages/js/src/utils/inline.ts b/packages/js/src/utils/inline.ts index f6d0ba34881f3..7cc06a48fe1a5 100644 --- a/packages/js/src/utils/inline.ts +++ b/packages/js/src/utils/inline.ts @@ -36,7 +36,7 @@ export function handleInliningBuild( ): InlineProjectGraph { const tsConfigJson = readJsonFile(tsConfigPath); const pathAliases = - tsConfigJson['compilerOptions']['paths'] || readBasePathAliases(context); + tsConfigJson['compilerOptions']?.['paths'] || readBasePathAliases(context); const inlineGraph = createInlineGraph(context, options, pathAliases); if (isInlineGraphEmpty(inlineGraph)) { diff --git a/packages/nx/src/plugins/js/index.ts b/packages/nx/src/plugins/js/index.ts index 56dbfe4eefd3d..deb4a55aeab02 100644 --- a/packages/nx/src/plugins/js/index.ts +++ b/packages/nx/src/plugins/js/index.ts @@ -23,24 +23,23 @@ export const processProjectGraph: ProjectGraphProcessor = async ( context ) => { const builder = new ProjectGraphBuilder(graph); + const pluginConfig = jsPluginConfig(readNxJson()); - // during the create-nx-workspace lock file might not exists yet - if (lockFileExists()) { - const lockHash = lockFileHash() ?? 'n/a'; - if (lockFileNeedsReprocessing(lockHash)) { - removeNpmNodes(graph, builder); - parseLockFile(builder); + if (pluginConfig.analyzePackageJson) { + // during the create-nx-workspace lock file might not exists yet + if (lockFileExists()) { + const lockHash = lockFileHash() ?? 'n/a'; + if (lockFileNeedsReprocessing(lockHash)) { + removeNpmNodes(graph, builder); + parseLockFile(builder); + } + writeLastProcessedLockfileHash(lockHash); } - writeLastProcessedLockfileHash(lockHash); - } - buildNpmPackageNodes(builder); + buildNpmPackageNodes(builder); + } - await buildExplicitDependencies( - jsPluginConfig(readNxJson()), - context, - builder - ); + await buildExplicitDependencies(pluginConfig, context, builder); return builder.getUpdatedProjectGraph(); };