UNPKG

react-cosmos

Version:

Sandbox for developing and testing UI components in isolation

15 lines (14 loc) 433 B
import { findNextAvailablePort } from '../shared/findNextAvailablePort.js'; export const portRetryPlugin = { name: 'portRetry', async config({ config, mode }) { if (mode === 'export') { return config; } const { port, portRetries } = config; return { ...config, port: portRetries ? await findNextAvailablePort(port, portRetries) : port, }; }, };