File tree Expand file tree Collapse file tree
packages/core/src/runtime/handler Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 strategy :
1818 matrix :
1919 os : [ubuntu-latest, windows-latest]
20- node-version : [14.x, 16.8]
20+ node-version : [12.x, 14.x, 16.8]
2121 runs-on : ${{ matrix.os }}
2222
2323 steps :
Original file line number Diff line number Diff line change @@ -139,10 +139,15 @@ export const NodeHandler: Definition<Bundle> = (opts) => {
139139 ...config ,
140140 plugins,
141141 } ) }
142- esbuild.build({
143- ...config,
144- plugins: config.plugins ? require(config.plugins) : undefined
145- })
142+ try {
143+ await esbuild.build({
144+ ...config,
145+ plugins: config.plugins ? require(config.plugins) : undefined
146+ })
147+ process.exit(0)
148+ } catch {
149+ process.exit(1)
150+ }
146151 }
147152 run()
148153 ` ;
@@ -153,11 +158,14 @@ export const NodeHandler: Definition<Bundle> = (opts) => {
153158 const result = spawn . sync ( "node" , [ builder ] , {
154159 stdio : "pipe" ,
155160 } ) ;
156- const err = ( result . stderr . toString ( ) + result . stdout . toString ( ) ) . trim ( ) ;
157- if ( err )
161+ if ( result . status !== 0 ) {
162+ const err = (
163+ result . stderr . toString ( ) + result . stdout . toString ( )
164+ ) . trim ( ) ;
158165 throw new Error (
159166 "There was a problem transpiling the Lambda handler: " + err
160167 ) ;
168+ }
161169
162170 fs . removeSync ( builder ) ;
163171
You can’t perform that action at this time.
0 commit comments