UNPKG

@nx/rspack

Version:

The Nx Plugin for Rspack contains executors and generators that support building applications using Rspack.

24 lines (23 loc) 934 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.withReact = withReact; const with_web_1 = require("./with-web"); const apply_react_config_1 = require("../plugins/utils/apply-react-config"); const deprecation_1 = require("./deprecation"); /** * @deprecated Will be removed in Nx v24. Use `NxReactRspackPlugin` from * `@nx/rspack/react-plugin` in a standard rspack config and run * `nx g @nx/rspack:convert-to-inferred`. See * https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details. */ function withReact(opts = {}) { (0, deprecation_1.warnRspackComposeHelpersDeprecation)(); return function makeConfig(config, { options, context }) { config = (0, with_web_1.withWeb)({ ...opts, cssModules: true })(config, { options, context, }); (0, apply_react_config_1.applyReactConfig)({}, config); return config; }; }