fix(react): webpack backwards compat for @nx/react/plugin/webpack
#20697
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now that our Webpack executor supports standard Webpack configuration files, we need to check if the exported function is a standard Webpack function
(env, args) -> config
or Nx-specific funtion(config, nxContext) -> config
. To be treated as an Nx-specific function, it needs to be called withcomposePlugins
, otherwise@nx/webpack:webpack
executor will pass the function to Webpack as a standard config.This means that legacy setup with this in
project.json
......will no longer build since
@nx/react/plugin/webpack
does not run throughcomposePlugins
.Current Behavior
Build is broken
Expected Behavior
Build works
Related Issue(s)
Fixes #20669
Notes
Also removes
getWebpackConfig
function that we deprecated in Nx 14 and was supposed to remove in Nx 16.