UNPKG

@nx/react

Version:

The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides: - Integration with libraries such as Jest, Vitest, Playwright, Cypress, and Storybook. - Generators for applica

16 lines (15 loc) 502 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findFreePort = findFreePort; const devkit_1 = require("@nx/devkit"); function findFreePort(host) { const projects = (0, devkit_1.getProjects)(host); let port = -Infinity; for (const [, p] of projects.entries()) { const curr = p.targets?.serve?.options?.port; if (typeof curr === 'number') { port = Math.max(port, curr); } } return port > 0 ? port + 1 : 4200; }