@nx/rspack
Version:
27 lines (26 loc) • 1.28 kB
TypeScript
import { type Tree } from '@nx/devkit';
import { type SupportedRspackMajorVersion } from './versions';
/**
* Returns the declared @rspack/core major version from the workspace's
* package.json when it matches a supported major, or `undefined` otherwise
* (fresh install, dist tag, unknown major). Below-floor enforcement is
* handled at generator entry points via `assertSupportedRspackVersion`.
*/
export declare function getInstalledRspackMajorVersion(tree: Tree): SupportedRspackMajorVersion | undefined;
/**
* Returns the installed @rspack/core major version resolved at runtime from
* node_modules. For use in executors and runtime code where no Tree is
* available. Returns `null` when @rspack/core can't be resolved or the
* installed major isn't supported.
*/
export declare function getInstalledRspackVersionRuntime(): SupportedRspackMajorVersion | null;
/**
* Returns the version-map entry for the installed major, falling back to the
* latest supported map when no installed version is detected (fresh install)
* or the detected major is outside the supported window.
*/
export declare function getRspackVersionsForInstalledMajor(tree: Tree): {
rspackCoreVersion: string;
rspackDevServerVersion: string;
rspackPluginReactRefreshVersion: string;
};