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 = {
36
36
async function main ( args ) {
37
37
let isProd = false ;
38
38
let shouldWatch = false ;
39
+ let shouldProfile = false ;
39
40
40
41
for ( const arg of args ) {
41
42
switch ( arg ) {
@@ -45,6 +46,9 @@ async function main(args) {
45
46
case '--watch' :
46
47
shouldWatch = true ;
47
48
break ;
49
+ case '--profile' :
50
+ shouldProfile = true ;
51
+ break ;
48
52
default :
49
53
throw new Error ( `Unknown arg: ${ arg } ` ) ;
50
54
}
@@ -53,6 +57,9 @@ async function main(args) {
53
57
/** @type {esbuild.BuildOptions } */
54
58
const buildOptions = {
55
59
...( isProd ? prodOptions : devOptions ) ,
60
+ ...( shouldProfile
61
+ ? { banner : { js : '#!/usr/bin/env node --cpu-prof' } }
62
+ : { } ) ,
56
63
} ;
57
64
58
65
console . log ( 'Building with options:' , buildOptions ) ;
You can’t perform that action at this time.
0 commit comments