This repository was archived by the owner on Sep 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -26,15 +26,19 @@ export default class RunCommand extends BaseCommand {
2626 aliases : [ "pre" ] ,
2727 description : "Use a prerelease version of the Modus runtime. Not needed if specifying a runtime version." ,
2828 } ) ,
29- "no- build" : Flags . boolean ( {
30- aliases : [ "nobuild" ] ,
31- description : "Don't build the app before running (or when watching for changes)" ,
29+ build : Flags . boolean ( {
30+ char : "b" ,
31+ description : "Build the app before running (or when watching for changes)" ,
3232 default : true ,
3333 } ) ,
3434 watch : Flags . boolean ( {
35- aliases : [ "w" ] ,
35+ char : "w" ,
3636 description : "Watch app code for changes" ,
37- default : true ,
37+ default : false ,
38+ } ) ,
39+ delay : Flags . integer ( {
40+ description : "Delay (in milliseconds) between file change detection and rebuild" ,
41+ default : 500 ,
3842 } ) ,
3943 } ;
4044
@@ -43,6 +47,12 @@ export default class RunCommand extends BaseCommand {
4347 static examples = [ "modus run" , "modus run ./my-app" , "modus run ./my-app --no-watch" ] ;
4448
4549 async run ( ) : Promise < void > {
46- DevCommand . run ( this . argv ) ;
50+ const { flags } = await this . parse ( RunCommand ) ;
51+ const argv = this . argv . filter ( ( arg ) => arg != "--watch" && arg != "-w" && arg != "--build" && arg != "-b" ) ;
52+
53+ if ( ! flags . watch ) argv . push ( "--no-watch" ) ;
54+ if ( ! flags . build ) argv . push ( "--no-build" ) ;
55+
56+ await DevCommand . run ( argv ) ;
4757 }
4858}
You can’t perform that action at this time.
0 commit comments