@@ -22,6 +22,7 @@ export interface ServeTaskOptions {
22
22
liveReloadPort ?: number ;
23
23
liveReloadBaseUrl ?: string ;
24
24
liveReloadLiveCss ?: boolean ;
25
+ target ?: string ;
25
26
environment ?: string ;
26
27
outputPath ?: string ;
27
28
ssl ?: boolean ;
@@ -45,22 +46,31 @@ module.exports = Command.extend({
45
46
{ name : 'live-reload-base-url' , type : String , aliases : [ 'lrbu' ] , description : 'Defaults to baseURL' } ,
46
47
{ name : 'live-reload-port' , type : Number , aliases : [ 'lrp' ] , description : '(Defaults to port number within [49152...65535])' } ,
47
48
{ name : 'live-reload-live-css' , type : Boolean , default : true , description : 'Whether to live reload CSS (default true)' } ,
48
- { name : 'environment' , type : String , default : 'development' , aliases : [ 'e' , { 'dev' : 'development' } , { 'mat' : 'material' } , { 'prod' : 'production' } ] } ,
49
+ { name : 'target' , type : String , default : 'development' , aliases : [ 't' , { 'dev' : 'development' } , { 'prod' : 'production' } ] } ,
50
+ { name : 'environment' , type : String , default : '' , aliases : [ 'e' ] } ,
49
51
{ name : 'output-path' , type : 'Path' , default : 'dist/' , aliases : [ 'op' , 'out' ] } ,
50
52
{ name : 'ssl' , type : Boolean , default : false } ,
51
53
{ name : 'ssl-key' , type : String , default : 'ssl/server.key' } ,
52
54
{ name : 'ssl-cert' , type : String , default : 'ssl/server.crt' }
53
55
] ,
54
56
55
57
run : function ( commandOptions : ServeTaskOptions ) {
58
+ if ( commandOptions . environment === '' ) {
59
+ if ( commandOptions . target === 'development' ) {
60
+ commandOptions . environment = 'dev' ;
61
+ }
62
+ if ( commandOptions . target === 'production' ) {
63
+ commandOptions . environment = 'prod' ;
64
+ }
65
+ }
56
66
57
67
commandOptions . liveReloadHost = commandOptions . liveReloadHost || commandOptions . host ;
58
68
59
69
return this . _checkExpressPort ( commandOptions )
60
70
. then ( this . _autoFindLiveReloadPort . bind ( this ) )
61
71
. then ( ( commandOptions : ServeTaskOptions ) => {
62
72
commandOptions = assign ( { } , commandOptions , {
63
- baseURL : this . project . config ( commandOptions . environment ) . baseURL || '/'
73
+ baseURL : this . project . config ( commandOptions . target ) . baseURL || '/'
64
74
} ) ;
65
75
66
76
if ( commandOptions . proxy ) {
0 commit comments