Closed lepirlouit closed 6 years ago
@lepirlouit Hey yeah one of our other users found this and we added it to the tutorial - https://serverless-stack.com/chapters/deploy-to-s3.html#app-bundle-size
Indeed. I didn't find this. Good Good.
@lepirlouit No worries. Thanks for pointing it out.
I suggest to replace the import statement in aws-lib
import AWS from 'aws-sdk';
withimport AWS from 'aws-sdk/global';
this will import aws config, etc without all the client services and apis.
This is enough to get the cognito credentials.
Size is reduced from 1.45mo to 145.69kb for aws-sdk.
source : https://github.com/aws/aws-sdk-js