From 36f930f48992316cef0738142672c69df0207fff Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 29 Aug 2018 22:19:53 -0400 Subject: [PATCH] use --live by default, if using Rollup or --no-hot --- src/api/dev.ts | 6 +++--- src/cli.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api/dev.ts b/src/api/dev.ts index dddf7a1..301a5e7 100644 --- a/src/api/dev.ts +++ b/src/api/dev.ts @@ -205,13 +205,13 @@ class Watcher extends EventEmitter { process: this.proc }); - if (this.live) { + if (this.hot && this.bundler === 'webpack') { this.dev_server.send({ - action: 'reload' + status: 'completed' }); } else { this.dev_server.send({ - status: 'completed' + action: 'reload' }); } })) diff --git a/src/cli.ts b/src/cli.ts index 74ff87d..f390f0d 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -11,8 +11,8 @@ prog.command('dev') .describe('Start a development server') .option('-p, --port', 'Specify a port') .option('-o, --open', 'Open a browser window') - .option('-l --live', 'Reload on changes', false) - .option('--hot', 'Use hot module replacement', true) + .option('--hot', 'Use hot module replacement (requires webpack)', true) + .option('-l --live', 'Reload on changes if not using --hot', true) .option('--bundler', 'Specify a bundler (rollup or webpack)') .action(async (opts: { port: number,