@@ -306,13 +306,17 @@ async function buildHandler(
306306
307307 log ( 'warning' , `🏗 - Building ${ handlerName } ...` ) ;
308308
309- const lambdaPath = join ( PROJECT_DIR , 'builds' , APP_ENV , handlerName ) ;
309+ const distPath = join ( PROJECT_DIR , 'dist' ) ;
310310 const srcPath = join ( PROJECT_DIR , 'src' ) ;
311- const srcRelativePath = relative ( lambdaPath , srcPath ) ;
311+ const lambdaPath = join ( PROJECT_DIR , 'builds' , APP_ENV , handlerName ) ;
312+ const distRelativePath = relative ( lambdaPath , distPath ) ;
312313
313314 const initializerContent = (
314315 await buildInitializer ( [ `MAIN_HANDLER_${ handlerName } ` , 'process' ] )
315- ) . replaceAll ( pathToFileURL ( srcPath ) . toString ( ) , srcRelativePath ) ;
316+ )
317+ . replaceAll ( pathToFileURL ( distPath ) . toString ( ) , distRelativePath )
318+ . replaceAll ( pathToFileURL ( srcPath ) . toString ( ) , distRelativePath )
319+ . replaceAll ( ".ts';" , ".js';" ) ;
316320 const indexContent = await buildHandlerIndex (
317321 { SCHEMA_VALIDATORS_OPTIONS } ,
318322 `MAIN_HANDLER_${ handlerName } ` ,
0 commit comments