From ec37bd1372e90e7a019828db27ca0006459fc5c9 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Tue, 12 Dec 2023 12:59:06 -0500 Subject: [PATCH] fix(webpack): fix check for standardWebpackConfigFunction (#20728) --- packages/webpack/src/executors/dev-server/dev-server.impl.ts | 4 ++-- packages/webpack/src/executors/webpack/webpack.impl.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/webpack/src/executors/dev-server/dev-server.impl.ts b/packages/webpack/src/executors/dev-server/dev-server.impl.ts index 1256c304b97cb9..0e33e323bb42e8 100644 --- a/packages/webpack/src/executors/dev-server/dev-server.impl.ts +++ b/packages/webpack/src/executors/dev-server/dev-server.impl.ts @@ -83,8 +83,8 @@ export async function* devServerExecutor( // Otherwise, user should define `devServer` option directly in their webpack config. if ( typeof userDefinedWebpackConfig === 'function' && - isNxWebpackComposablePlugin(userDefinedWebpackConfig) && - !buildOptions.standardWebpackConfigFunction + (isNxWebpackComposablePlugin(userDefinedWebpackConfig) || + !buildOptions.standardWebpackConfigFunction) ) { config = await userDefinedWebpackConfig( { devServer }, diff --git a/packages/webpack/src/executors/webpack/webpack.impl.ts b/packages/webpack/src/executors/webpack/webpack.impl.ts index 3d060bc8309428..9e44337fd87079 100644 --- a/packages/webpack/src/executors/webpack/webpack.impl.ts +++ b/packages/webpack/src/executors/webpack/webpack.impl.ts @@ -60,8 +60,8 @@ async function getWebpackConfigs( if ( typeof userDefinedWebpackConfig === 'function' && - isNxWebpackComposablePlugin(userDefinedWebpackConfig) && - !options.standardWebpackConfigFunction + (isNxWebpackComposablePlugin(userDefinedWebpackConfig) || + !options.standardWebpackConfigFunction) ) { // Old behavior, call the Nx-specific webpack config function that user exports return await userDefinedWebpackConfig(config, {