From d008c6595ee88e5d3a1ba204e1b35053f3fa7bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Fri, 21 Jun 2024 16:09:16 +0200 Subject: [PATCH] fix(webpack): set global.NX_GRAPH_CREATION when running plugin in crystal migration --- .../plugin-migrations/executor-to-plugin-migrator.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator.ts b/packages/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator.ts index f9aca6b10a8f2d..0b663fb0ee6fb9 100644 --- a/packages/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator.ts +++ b/packages/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator.ts @@ -402,6 +402,7 @@ class ExecutorToPluginMigrator { return; } + global.NX_GRAPH_CREATION = true; for (const targetName of this.#targetAndProjectsToMigrate.keys()) { const loadedPlugin = new LoadedNxPlugin( { @@ -425,12 +426,14 @@ class ExecutorToPluginMigrator { if (e instanceof ProjectConfigurationsError) { projectConfigs = e.partialProjectConfigurationsResult; } else { + global.NX_GRAPH_CREATION = false; throw e; } } this.#createNodesResultsForTargets.set(targetName, projectConfigs); } + global.NX_GRAPH_CREATION = false; } }