From 35a33ae5f68b4ae1c6260b3df8ccb36041cc3dd1 Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Tue, 6 Aug 2024 17:16:54 -0400 Subject: [PATCH] fix(core): reenable isolation on windows --- .../src/project-graph/plugins/internal-api.ts | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/packages/nx/src/project-graph/plugins/internal-api.ts b/packages/nx/src/project-graph/plugins/internal-api.ts index 6bc38f0a67ae0..33359f5f831fd 100644 --- a/packages/nx/src/project-graph/plugins/internal-api.ts +++ b/packages/nx/src/project-graph/plugins/internal-api.ts @@ -146,19 +146,32 @@ export const nxPluginCache: Map< [Promise, () => void] > = new Map(); +function isIsolationEnabled() { + // Explicitly enabled, regardless of further conditions + if (process.env.NX_ISOLATE_PLUGINS === 'true') { + return true; + } + if ( + // Explicitly disabled + process.env.NX_ISOLATE_PLUGINS === 'false' || + // Isolation is disabled on WASM builds currently. + IS_WASM + ) { + return false; + } + // Default value + return true; +} + export async function loadNxPlugins( plugins: PluginConfiguration[], root = workspaceRoot ): Promise void]> { performance.mark('loadNxPlugins:start'); - const loadingMethod = - process.env.NX_ISOLATE_PLUGINS === 'true' || - (!IS_WASM && - platform() !== 'win32' && - process.env.NX_ISOLATE_PLUGINS !== 'false') - ? loadNxPluginInIsolation - : loadNxPlugin; + const loadingMethod = isIsolationEnabled() + ? loadNxPluginInIsolation + : loadNxPlugin; plugins = await normalizePlugins(plugins, root);