UNPKG

@nx/rspack

Version:

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

31 lines (30 loc) 2.51 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RSPACK_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE = exports.RSPACK_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = exports.RSPACK_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = void 0; exports.warnRspackMfDevServerExecutorDeprecation = warnRspackMfDevServerExecutorDeprecation; exports.warnRspackMfSsrDevServerExecutorDeprecation = warnRspackMfSsrDevServerExecutorDeprecation; exports.warnRspackMfStaticServerExecutorDeprecation = warnRspackMfStaticServerExecutorDeprecation; const devkit_1 = require("@nx/devkit"); // TODO(v24): Remove these MF executors. Dynamic federation in the new // `@nx/react:consumer` generator removes the orchestration need. const MIGRATION_URL = 'https://nx.dev/docs/technologies/module-federation/consumer-and-provider'; exports.RSPACK_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = `The \`@nx/rspack:module-federation-dev-server\` executor is deprecated and will be removed in Nx v24. Dynamic federation in \`@nx/react:consumer\` removes the need for host-orchestrated remote serving. See ${MIGRATION_URL} for the v23 migration guide.`; exports.RSPACK_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = `The \`@nx/rspack:module-federation-ssr-dev-server\` executor is deprecated and will be removed in Nx v24. SSR is not first-classed in the new generators; see ${MIGRATION_URL} for guidance on wiring SSR with \`@nx/react:consumer\`.`; exports.RSPACK_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE = `The \`@nx/rspack:module-federation-static-server\` executor is deprecated and will be removed in Nx v24. Use plain \`rsbuild preview\` / \`sirv-cli\` via \`nx:run-commands\` if a static-serve workflow is still needed. See ${MIGRATION_URL} for details.`; // Executor warnings fire once per process to avoid flooding dev-server loops. const executorWarned = new Set(); function warnOnce(key, message) { if (executorWarned.has(key)) return; executorWarned.add(key); devkit_1.logger.warn(message); } function warnRspackMfDevServerExecutorDeprecation() { warnOnce('rspack-mf-dev-server', exports.RSPACK_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE); } function warnRspackMfSsrDevServerExecutorDeprecation() { warnOnce('rspack-mf-ssr-dev-server', exports.RSPACK_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE); } function warnRspackMfStaticServerExecutorDeprecation() { warnOnce('rspack-mf-static-server', exports.RSPACK_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE); }