I am using AWS AMPLIFY CONSOLE to launch a React App
I have created the React App using Amplify Auth and Amplify core.
My app is built and running very well, but the main .js bundle size is 1,3MB. Too high!!
I want to reduce the bundle size, but I don't know how to force to serve only the .js.gz (gzipped version of the bundle) instead of the plain js version.
Its possible to get this in AWS Amplify?
Thanks in advance,
Are you using the hosting feature or do you have a cloud front as a CDN delivering your application?
Then check the 'Compress Objects Automatically' option in Cloud Front, but I think that it is activated by default. For more Information check the following link => https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html
So CloudFront should automatically take care of serving your static files gzip, if your client send the corresponding Accept-Encoding header.
I am using the AWS Amplify Console, not directly Cloudfront.
If you are using the modular imports of Auth (@aws-amplify/auth) and Core(@aws-amplify/core) it will help shrink the bundle size. I will move this issue to the Amplify Console issue queue to provide further insight on how to reduce bundle size with their hosting solution.
Closing as duplicate of #330
Hello all,
My question is identical to @rallona's.
Did anyone ever figure out how to serve GZip-ed web assets when hosting an Amplify Front-End with the AWS Amplify Console?
Having the same issue here trying to reduce my bundle size using the Amplify console instead of Cloudfront directly. It says "file size after gzip" in the build logs is ~3mb, however, when I run it through a website analyzer (gtmetrix.com), it says it is over 17mb so doesn't seem like it's actually compressed.
Same issue. +1
Can some one from Amplify team answer this ?
Most helpful comment
Same issue. +1
Can some one from Amplify team answer this ?