File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 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 {
201201 }
202202 }
203203
204- async bundle ( incremental = false ) : Promise < BuildResult [ ] > {
204+ async bundle ( incremental = true ) : Promise < BuildResult [ ] > {
205205 this . prepare ( ) ;
206206 this . serverless . cli . log ( 'Compiling with esbuild...' ) ;
207207
@@ -226,9 +226,16 @@ export class EsbuildPlugin implements Plugin {
226226 delete config [ 'watch' ] ;
227227 delete config [ 'pugins' ] ;
228228
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+
229237 const result = await build ( config ) ;
230238
231- const bundlePath = entry . substr ( 0 , entry . lastIndexOf ( '.' ) ) + '.js' ;
232239 return { result, bundlePath, func } ;
233240 } )
234241 ) . then ( results => {
You can’t perform that action at this time.
0 commit comments