From 1a63d151deea55e68b75bc0bc6bb17e92ae1e884 Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Sat, 9 Dec 2023 14:18:15 +0100 Subject: [PATCH] fix(webpack): fixed `isolatedConfig: false` option not composing plugins --- packages/webpack/src/executors/webpack/webpack.impl.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/webpack/src/executors/webpack/webpack.impl.ts b/packages/webpack/src/executors/webpack/webpack.impl.ts index 59f61c7ff00e5..5b51215417bd1 100644 --- a/packages/webpack/src/executors/webpack/webpack.impl.ts +++ b/packages/webpack/src/executors/webpack/webpack.impl.ts @@ -23,7 +23,7 @@ import type { } from './schema'; import { normalizeOptions } from './lib/normalize-options'; import { - composePlugins, + composePluginsSync, isNxWebpackComposablePlugin, } from '../../utils/config'; import { withNx } from '../../utils/with-nx'; @@ -54,7 +54,9 @@ async function getWebpackConfigs( const config = options.isolatedConfig ? {} - : composePlugins(withNx(options), withWeb(options)); + : (options.target === 'web' + ? composePluginsSync(withNx(options), withWeb(options)) + : withNx(options))({}, { options, context }); if (isNxWebpackComposablePlugin(userDefinedWebpackConfig)) { // Old behavior, call the Nx-specific webpack config function that user exports