@@ -20,6 +20,9 @@ const TYPESCRIPT_PLUGIN_BUILD_DIR_WEBPACK = '.webpack/service'; //TODO detect fr
20
20
// Plugin naming and build directory of serverless-webpack plugin
21
21
const TS_PLUGIN_ESBUILD = 'EsbuildServerlessPlugin' ;
22
22
const TYPESCRIPT_PLUGIN_BUILD_DIR_ESBUILD = '.esbuild/.build' ; //TODO detect from esbuild.config.js
23
+ // Plugin naming and build directory of esbuild built-in with Serverless Framework
24
+ const TS_PLUGIN_BUILTIN_ESBUILD = 'Esbuild' ;
25
+ const TYPESCRIPT_PLUGIN_BUILD_DIR_BUILTIN_ESBUILD = '.serverless/build' ; //TODO detect from esbuild.config.js
23
26
24
27
// Default AWS endpoint URL
25
28
const DEFAULT_AWS_ENDPOINT_URL = 'http://localhost:4566' ;
@@ -292,6 +295,13 @@ class LocalstackPlugin {
292
295
if ( this . findPlugin ( TS_PLUGIN_TSC ) ) return TS_PLUGIN_TSC ;
293
296
if ( this . findPlugin ( TS_PLUGIN_WEBPACK ) ) return TS_PLUGIN_WEBPACK ;
294
297
if ( this . findPlugin ( TS_PLUGIN_ESBUILD ) ) return TS_PLUGIN_ESBUILD ;
298
+ const builtinEsbuildPlugin = this . findPlugin ( TS_PLUGIN_BUILTIN_ESBUILD ) ;
299
+ if ( builtinEsbuildPlugin &&
300
+ builtinEsbuildPlugin . constructor &&
301
+ typeof builtinEsbuildPlugin . constructor . WillEsBuildRun === 'function' &&
302
+ builtinEsbuildPlugin . constructor . WillEsBuildRun ( this . serverless . configurationInput , this . serverless . serviceDir ) ) {
303
+ return TS_PLUGIN_BUILTIN_ESBUILD ;
304
+ }
295
305
return undefined ;
296
306
}
297
307
@@ -303,6 +313,9 @@ class LocalstackPlugin {
303
313
return TYPESCRIPT_PLUGIN_BUILD_DIR_WEBPACK ;
304
314
if ( TS_PLUGIN === TS_PLUGIN_ESBUILD )
305
315
return TYPESCRIPT_PLUGIN_BUILD_DIR_ESBUILD ;
316
+ if ( TS_PLUGIN === TS_PLUGIN_BUILTIN_ESBUILD ) {
317
+ return TYPESCRIPT_PLUGIN_BUILD_DIR_BUILTIN_ESBUILD ;
318
+ }
306
319
return undefined ;
307
320
}
308
321
0 commit comments