File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,7 @@ async function runEsbuildWasi(
99
99
100
100
let exitCode : number ;
101
101
try {
102
- wasi . start ( instance as any ) ;
103
- exitCode = 0 ;
102
+ exitCode = wasi . start ( instance as any ) ;
104
103
} catch ( e ) {
105
104
if ( e instanceof WASIProcExit ) {
106
105
exitCode = e . code ;
@@ -109,14 +108,14 @@ async function runEsbuildWasi(
109
108
}
110
109
}
111
110
112
- if ( exitCode !== 0 ) {
113
- return stderr ;
114
- }
115
-
116
111
const wasiHeader = `// esbuild v${ ESBUILD_VERSION } (GOOS=wasip1 GOARCH=wasm)`
117
112
+ `\n// args: ${ args . slice ( 1 ) . filter ( ( v ) => ! v . startsWith ( "--log" ) ) . join ( " " ) } `
118
113
+ "\n\n" ;
119
114
115
+ if ( exitCode !== 0 ) {
116
+ return wasiHeader + stderr . trim ( ) ;
117
+ }
118
+
120
119
if ( stdoutOutput ) {
121
120
return wasiHeader + stdout . trim ( ) ;
122
121
}
You can’t perform that action at this time.
0 commit comments