mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-11 14:20:07 +08:00
feat(cli): Add —no-open option to cli dev command.
This commit is contained in:
parent
04ff15f89e
commit
bc5b12fce3
@ -28,6 +28,7 @@ async function runDevServer({ context, directory }) {
|
||||
LOWDEFY_BUILD_REF_RESOLVER: context.options.refResolver,
|
||||
LOWDEFY_DIRECTORY_CONFIG: context.directories.config,
|
||||
LOWDEFY_PACKAGE_MANAGER: context.packageManager,
|
||||
LOWDEFY_SERVER_DEV_OPEN_BROWSER: !!context.options.open,
|
||||
LOWDEFY_SERVER_DEV_WATCH: JSON.stringify(context.options.watch),
|
||||
LOWDEFY_SERVER_DEV_WATCH_IGNORE: JSON.stringify(context.options.watchIgnore),
|
||||
PORT: context.options.port,
|
||||
|
@ -69,6 +69,7 @@ program
|
||||
'Change config directory. Default is the current working directory.'
|
||||
)
|
||||
.option('--disable-telemetry', 'Disable telemetry.')
|
||||
.option('--no-open', 'Do not open a new tab in the default browser.')
|
||||
.option(
|
||||
'--package-manager <package-manager>',
|
||||
'The package manager to use. Options are "npm" or "yarn".'
|
||||
|
@ -80,7 +80,9 @@ async function run() {
|
||||
try {
|
||||
const serverPromise = startServer(context);
|
||||
await wait(800);
|
||||
opener(`http://localhost:${context.options.port}`);
|
||||
if (process.env.LOWDEFY_SERVER_DEV_OPEN_BROWSER === 'true') {
|
||||
opener(`http://localhost:${context.options.port}`);
|
||||
}
|
||||
await serverPromise;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
Loading…
Reference in New Issue
Block a user