You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
This causes problems with bundling, such as esbuild, because they are unable to bundle the required files.
Could this be changed to something like this:
import*asProxyIntegrationfrom"aws-lambda-router/lib/proxyIntegration";import*asSnsIntegrationfrom"aws-lambda-router/lib/sns";import*asSqsIntegrationfrom"aws-lambda-router/lib/sqs";import*asS3Integrationfrom"aws-lambda-router/lib/s3";constprocessors={proxyIntegration: ProxyIntegration,sns: SnsIntegration,sqs: SqsIntegration,s3: S3Integration,};constextractEventProcessorMapping=(routeConfig: RouteConfig)=>{constprocessorMap=newMap<string,EventProcessor>();for(constkeyofObject.keys(routeConfig)){if(key==="debug"||key==="onError"){continue;}try{constprocessor=processors[key];if(!processor){thrownewError(`Could not find processor ${key}`);}processorMap.set(key,processor);}catch(error){thrownewError(`The event processor '${key}', that is mentioned in the routerConfig, cannot be instantiated (${error.toString()})`);}}returnprocessorMap;};
This way imports are static, and esbuild could bundle the project.
The text was updated successfully, but these errors were encountered:
Hi @TomiTakussaari , i think you are right. We don't really need dynamic loading at this point. If I can find the time, I will look into it. But if you have the desire to create a PR, then feel free to do so.
Hi
Index.ts uses dynamic importing to dynamically load only the processors that are needed.
This causes problems with bundling, such as esbuild, because they are unable to bundle the required files.
Could this be changed to something like this:
This way imports are static, and esbuild could bundle the project.
The text was updated successfully, but these errors were encountered: