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

package.exclude from the serverless.yml is being ignored

Open stanyq4 opened this issue 1 year ago • 0 comments

In the serverless.yml, I am specifying the following node modules to be excluded as part of the layer:

package:
  excludeDevDependencies: true
  exclude:
    - node_modules/@aws-sdk/**
    - node_modules/@azure/**
    - node_modules/@baemingo/**
    - node_modules/sqreen/**
    - node_modules/sqreen-info/**

AWS SDK is around 50MB and is included by default in all lambdas, so it makes no sense to package it as part of the layer.

However, when the layer is being created it still includes the @aws-sdk folder from node_modules

Created layer package /Users/stanyeshchenko/Dev/projects/api-demo/.serverless/api-demo-nodejs-default.zip (88.9 MB)

Attaching a screenshot with layer that I downloaded from S3, you can see that aws-sdk is not excluded

Screen Shot 2022-10-01 at 11 19 39 AM

stanyq4 avatar Oct 01 '22 15:10 stanyq4