11import * as denodeify from 'denodeify' ;
22import { BuildOptions } from '../models/build-options' ;
3- import { BaseBuildCommandOptions } from './build' ;
3+ import { baseBuildCommandOptions } from './build' ;
44import { CliConfig } from '../models/config' ;
55import { Version } from '../upgrade/version' ;
66import { ServeTaskOptions } from './serve' ;
@@ -32,21 +32,35 @@ export interface ServeTaskOptions extends BuildOptions {
3232 hmr ?: boolean ;
3333}
3434
35+ // Expose options unrelated to live-reload to other commands that need to run serve
36+ export const baseServeCommandOptions : any = baseBuildCommandOptions . concat ( [
37+ { name : 'port' , type : Number , default : defaultPort , aliases : [ 'p' ] } ,
38+ {
39+ name : 'host' ,
40+ type : String ,
41+ default : defaultHost ,
42+ aliases : [ 'H' ] ,
43+ description : `Listens only on ${ defaultHost } by default`
44+ } ,
45+ { name : 'proxy-config' , type : 'Path' , aliases : [ 'pc' ] } ,
46+ { name : 'ssl' , type : Boolean , default : false } ,
47+ { name : 'ssl-key' , type : String , default : 'ssl/server.key' } ,
48+ { name : 'ssl-cert' , type : String , default : 'ssl/server.crt' } ,
49+ {
50+ name : 'open' ,
51+ type : Boolean ,
52+ default : false ,
53+ aliases : [ 'o' ] ,
54+ description : 'Opens the url in default browser' ,
55+ }
56+ ] ) ;
57+
3558const ServeCommand = Command . extend ( {
3659 name : 'serve' ,
3760 description : 'Builds and serves your app, rebuilding on file changes.' ,
3861 aliases : [ 'server' , 's' ] ,
3962
40- availableOptions : BaseBuildCommandOptions . concat ( [
41- { name : 'port' , type : Number , default : defaultPort , aliases : [ 'p' ] } ,
42- {
43- name : 'host' ,
44- type : String ,
45- default : defaultHost ,
46- aliases : [ 'H' ] ,
47- description : `Listens only on ${ defaultHost } by default`
48- } ,
49- { name : 'proxy-config' , type : 'Path' , aliases : [ 'pc' ] } ,
63+ availableOptions : baseServeCommandOptions . concat ( [
5064 { name : 'live-reload' , type : Boolean , default : true , aliases : [ 'lr' ] } ,
5165 {
5266 name : 'live-reload-host' ,
@@ -72,16 +86,6 @@ const ServeCommand = Command.extend({
7286 default : true ,
7387 description : 'Whether to live reload CSS (default true)'
7488 } ,
75- { name : 'ssl' , type : Boolean , default : false } ,
76- { name : 'ssl-key' , type : String , default : 'ssl/server.key' } ,
77- { name : 'ssl-cert' , type : String , default : 'ssl/server.crt' } ,
78- {
79- name : 'open' ,
80- type : Boolean ,
81- default : false ,
82- aliases : [ 'o' ] ,
83- description : 'Opens the url in default browser' ,
84- } ,
8589 {
8690 name : 'hmr' ,
8791 type : Boolean ,
0 commit comments