Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Commit a84202c

Browse files
RaeesBhattiswyxio
authored andcommitted
Make ports for local server dynamic (#205)
* Make ports for local server dynamic * Check for port flag
1 parent 29a70d2 commit a84202c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/commands/dev/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,19 @@ class DevCommand extends Command {
212212
settings = {
213213
noCmd: true,
214214
port: 8888,
215-
proxyPort: 3999,
215+
proxyPort: await getPort({ port: 3999 }),
216216
dist
217217
};
218218
}
219219

220+
// Reset port if not manually specified, to make it dynamic
221+
if (!(config.dev && config.dev.port) && !flags.port) {
222+
settings = {
223+
port: await getPort({ port: settings.port }),
224+
...settings
225+
};
226+
}
227+
220228
startDevServer(settings, this.log);
221229

222230
// serve functions from zip-it-and-ship-it

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy