packages/react/src/migrations/update-23-0-0/remove-nx-react-webpack-plugin-import.md
NxReactWebpackPlugin Imports to the @nx/react/webpack-plugin Sub-pathThe deprecated re-export of NxReactWebpackPlugin from @nx/react is removed in v23. The migration rewrites both ES module imports and CJS require() calls to use the @nx/react/webpack-plugin sub-path. Imports that combine the deprecated symbol with other named imports are split into two declarations so the rest of the original import still resolves from @nx/react. Aliases (as Plugin, : Plugin) are preserved.
ES module import.
import { NxReactWebpackPlugin } from '@nx/react';
export default { plugins: [new NxReactWebpackPlugin()] };
import { NxReactWebpackPlugin } from '@nx/react/webpack-plugin';
export default { plugins: [new NxReactWebpackPlugin()] };
ES module import combined with other named imports.
import { NxReactWebpackPlugin, withReact } from '@nx/react';
import { NxReactWebpackPlugin } from '@nx/react/webpack-plugin';
import { withReact } from '@nx/react';
CJS require().
const { NxReactWebpackPlugin } = require('@nx/react');
const { NxReactWebpackPlugin } = require('@nx/react/webpack-plugin');