File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ const prodOptions = {
3636async function main ( args ) {
3737 let isProd = false ;
3838 let shouldWatch = false ;
39+ let shouldProfile = false ;
3940
4041 for ( const arg of args ) {
4142 switch ( arg ) {
@@ -45,6 +46,9 @@ async function main(args) {
4546 case '--watch' :
4647 shouldWatch = true ;
4748 break ;
49+ case '--profile' :
50+ shouldProfile = true ;
51+ break ;
4852 default :
4953 throw new Error ( `Unknown arg: ${ arg } ` ) ;
5054 }
@@ -53,6 +57,9 @@ async function main(args) {
5357 /** @type {esbuild.BuildOptions } */
5458 const buildOptions = {
5559 ...( isProd ? prodOptions : devOptions ) ,
60+ ...( shouldProfile
61+ ? { banner : { js : '#!/usr/bin/env node --cpu-prof' } }
62+ : { } ) ,
5663 } ;
5764
5865 console . log ( 'Building with options:' , buildOptions ) ;
You can’t perform that action at this time.
0 commit comments