serverless-esbuild icon indicating copy to clipboard operation
serverless-esbuild copied to clipboard

Application Size

Open samuelcastro opened this issue 2 years ago • 4 comments

Describe the bug For some reason my application size was 900kb before using this plugin and simply by adding it went up to 2Mb without any changes.

Do you guys have any idea why?

Screen Shot 2022-06-24 at 4 30 28 PM

Screen Shot 2022-06-24 at 4 30 34 PM

samuelcastro avatar Jun 24 '22 20:06 samuelcastro

Are you using include patterns?

With default Serverless you need to use patterns whereas with this we bring in what you need unless it's some external binary/file you reference dynamically eg. fs.readFile("somefile.txt").

You can look inside the zip for info

samchungy avatar Jun 25 '22 00:06 samchungy

Well, I just followed the basic setup for a simple js serverless project. I have not added any patterns. @samchungy

This is my only configuration:

custom:
   esbuild:
      packager: yarn

And this is my folder structure: Screen Shot 2022-06-27 at 11 36 21 AM

samuelcastro avatar Jun 27 '22 15:06 samuelcastro

Just fyi, I am using the serverless-layers plugin.

samuelcastro avatar Jun 27 '22 17:06 samuelcastro

Can you look inside the zip for any info on what's different between the two? It's difficult to speculate based on your screenshots.

samchungy avatar Jun 27 '22 23:06 samchungy