From 02e3d07b90651d7e9168314a4a93890f5b466d13 Mon Sep 17 00:00:00 2001 From: otofune Date: Fri, 31 May 2019 00:33:34 +0900 Subject: [PATCH] Make port and dir flag available - Fix type of 'dir' option - Use flags.dir / flags.port in application --- src/commands/dev/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/dev/index.js b/src/commands/dev/index.js index d42f255..2c4ab66 100644 --- a/src/commands/dev/index.js +++ b/src/commands/dev/index.js @@ -191,6 +191,7 @@ class DevCommand extends Command { `${NETLIFYDEVWARN} No dev server detected, using simple static server` ); let dist = + flags.dir || (config.dev && config.dev.publish) || (config.build && config.build.publish); if (!dist) { @@ -211,7 +212,7 @@ class DevCommand extends Command { } settings = { noCmd: true, - port: 8888, + port: flags.port || 8888, proxyPort: 3999, dist }; @@ -296,7 +297,7 @@ DevCommand.strict = false; DevCommand.flags = { command: flags.string({ char: "c", description: "command to run" }), port: flags.integer({ char: "p", description: "port of netlify dev" }), - dir: flags.integer({ char: "d", description: "dir with static files" }), + dir: flags.string({ char: "d", description: "dir with static files" }), functions: flags.string({ char: "f", description: "Specify a functions folder to serve"