Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2baf547

Browse files
meeroslavFrozenPandaz
authored andcommittedApr 11, 2023
fix(core): respect analyzePackageJson for processProjectGraph (#16220)
(cherry picked from commit afb37c8)
1 parent 4f67552 commit 2baf547

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed
 

‎packages/js/src/utils/inline.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function handleInliningBuild(
3636
): InlineProjectGraph {
3737
const tsConfigJson = readJsonFile(tsConfigPath);
3838
const pathAliases =
39-
tsConfigJson['compilerOptions']['paths'] || readBasePathAliases(context);
39+
tsConfigJson['compilerOptions']?.['paths'] || readBasePathAliases(context);
4040
const inlineGraph = createInlineGraph(context, options, pathAliases);
4141

4242
if (isInlineGraphEmpty(inlineGraph)) {

‎packages/nx/src/plugins/js/index.ts

+13-14
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,23 @@ export const processProjectGraph: ProjectGraphProcessor = async (
2323
context
2424
) => {
2525
const builder = new ProjectGraphBuilder(graph);
26+
const pluginConfig = jsPluginConfig(readNxJson());
2627

27-
// during the create-nx-workspace lock file might not exists yet
28-
if (lockFileExists()) {
29-
const lockHash = lockFileHash() ?? 'n/a';
30-
if (lockFileNeedsReprocessing(lockHash)) {
31-
removeNpmNodes(graph, builder);
32-
parseLockFile(builder);
28+
if (pluginConfig.analyzePackageJson) {
29+
// during the create-nx-workspace lock file might not exists yet
30+
if (lockFileExists()) {
31+
const lockHash = lockFileHash() ?? 'n/a';
32+
if (lockFileNeedsReprocessing(lockHash)) {
33+
removeNpmNodes(graph, builder);
34+
parseLockFile(builder);
35+
}
36+
writeLastProcessedLockfileHash(lockHash);
3337
}
34-
writeLastProcessedLockfileHash(lockHash);
35-
}
3638

37-
buildNpmPackageNodes(builder);
39+
buildNpmPackageNodes(builder);
40+
}
3841

39-
await buildExplicitDependencies(
40-
jsPluginConfig(readNxJson()),
41-
context,
42-
builder
43-
);
42+
await buildExplicitDependencies(pluginConfig, context, builder);
4443

4544
return builder.getUpdatedProjectGraph();
4645
};

0 commit comments

Comments
 (0)
Please sign in to comment.