@@ -22,6 +22,7 @@ export interface ServeTaskOptions {
2222 liveReloadPort ?: number ;
2323 liveReloadBaseUrl ?: string ;
2424 liveReloadLiveCss ?: boolean ;
25+ target ?: string ;
2526 environment ?: string ;
2627 outputPath ?: string ;
2728 ssl ?: boolean ;
@@ -45,22 +46,31 @@ module.exports = Command.extend({
4546 { name : 'live-reload-base-url' , type : String , aliases : [ 'lrbu' ] , description : 'Defaults to baseURL' } ,
4647 { name : 'live-reload-port' , type : Number , aliases : [ 'lrp' ] , description : '(Defaults to port number within [49152...65535])' } ,
4748 { 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' ] } ,
4951 { name : 'output-path' , type : 'Path' , default : 'dist/' , aliases : [ 'op' , 'out' ] } ,
5052 { name : 'ssl' , type : Boolean , default : false } ,
5153 { name : 'ssl-key' , type : String , default : 'ssl/server.key' } ,
5254 { name : 'ssl-cert' , type : String , default : 'ssl/server.crt' }
5355 ] ,
5456
5557 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+ }
5666
5767 commandOptions . liveReloadHost = commandOptions . liveReloadHost || commandOptions . host ;
5868
5969 return this . _checkExpressPort ( commandOptions )
6070 . then ( this . _autoFindLiveReloadPort . bind ( this ) )
6171 . then ( ( commandOptions : ServeTaskOptions ) => {
6272 commandOptions = assign ( { } , commandOptions , {
63- baseURL : this . project . config ( commandOptions . environment ) . baseURL || '/'
73+ baseURL : this . project . config ( commandOptions . target ) . baseURL || '/'
6474 } ) ;
6575
6676 if ( commandOptions . proxy ) {
0 commit comments