Excluding part of a npm package from a claudia.js build

261 Views Asked by At

I'm currently using claudia.js to deploy serverless functions to AWS Lambda. However, due to size limitations I run into the following error:

RequestEntityTooLargeException: Request must be smaller than 69905067 bytes for the CreateFunction operation

To resolve this, I'm trying to exclude a subfolder of a npm package as it's not needed, but I'm unsure how to do this during the claudia build process.

Specifically, I'd want to exclude an example subfolder > node_modules/packet/subfolder/*

I've messed around with various configurations of .gitignore and .npmignore but with little success. Any help would be amazing!

1

There are 1 best solutions below

0
Slobodan Stojanovic On

Instead of doing that you can simply use --use-s3-bucket option with Claudia.js and 50mb limit will be increased to 250mb (uncompressed).

Try running the following command:

claudia update --use-s3-bucket BUCKET_NAME --region YOUR_REGION

Where BUCKET_NAME is a name of the deployment helper bucket in the same region (YOUR_REGION).