From 5f7d46354e0d62fa6a36059c5b7e9c46642c4115 Mon Sep 17 00:00:00 2001 From: Jacob S Date: Mon, 9 Jun 2025 03:15:33 -0700 Subject: [PATCH] fix(react): allow for buildTargetWebpack to have an executor of @nx/webpack:webpack or @nx/rspack:rspack (#30253) closed #30235 ## Current Behavior nxComponentTestingPreset for webpack cannot use rspack as an executor. ## Expected Behavior nxComponentTestingPreset for webpack can use webpack or rspack as an executor. ## Related Issue(s) #30235 Fixes #30235 --- packages/react/plugins/component-testing/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/react/plugins/component-testing/index.ts b/packages/react/plugins/component-testing/index.ts index b83d1697ff..7c246606f3 100644 --- a/packages/react/plugins/component-testing/index.ts +++ b/packages/react/plugins/component-testing/index.ts @@ -237,11 +237,13 @@ function buildTargetWebpack( if ( buildableProjectConfig.targets[parsed.target].executor !== - '@nx/webpack:webpack' + '@nx/webpack:webpack' && + buildableProjectConfig.targets[parsed.target].executor !== + '@nx/rspack:rspack' ) { throw new InvalidExecutorError( - `The '${parsed.target}' target of the '${parsed.project}' project is not using the '@nx/webpack:webpack' executor. ` + - `Please make sure to use '@nx/webpack:webpack' executor in that target to use Cypress Component Testing.` + `The '${parsed.target}' target of the '${parsed.project}' project is not using the '@nx/webpack:webpack' or '@nx/rspack:rspack' executor. ` + + `Please make sure to use '@nx/webpack:webpack' or '@nx/rspack:rspack' executor in that target to use Cypress Component Testing.` ); }