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
This commit is contained in:
Jacob S 2025-06-09 03:15:33 -07:00 committed by GitHub
parent 438457ab12
commit 5f7d46354e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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.`
);
}