File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ export class EsbuildPlugin implements Plugin {
201
201
}
202
202
}
203
203
204
- async bundle ( incremental = false ) : Promise < BuildResult [ ] > {
204
+ async bundle ( incremental = true ) : Promise < BuildResult [ ] > {
205
205
this . prepare ( ) ;
206
206
this . serverless . cli . log ( 'Compiling with esbuild...' ) ;
207
207
@@ -226,9 +226,16 @@ export class EsbuildPlugin implements Plugin {
226
226
delete config [ 'watch' ] ;
227
227
delete config [ 'pugins' ] ;
228
228
229
+ const bundlePath = entry . substr ( 0 , entry . lastIndexOf ( '.' ) ) + '.js' ;
230
+
231
+ if ( this . buildResults ) {
232
+ const { result } = this . buildResults . find ( ( { func : fn } ) => fn . name === func . name ) ;
233
+ await result . rebuild ( ) ;
234
+ return { result, bundlePath, func } ;
235
+ }
236
+
229
237
const result = await build ( config ) ;
230
238
231
- const bundlePath = entry . substr ( 0 , entry . lastIndexOf ( '.' ) ) + '.js' ;
232
239
return { result, bundlePath, func } ;
233
240
} )
234
241
) . then ( results => {
You can’t perform that action at this time.
0 commit comments