Skip to content

Change in package/exclude usage? #3869

@sbstjn

Description

@sbstjn

Have there been changes in how to exclude paths from being included in the package? I see different archive sizes (22kb compared to 6.7mb) when using 1.15.3 and 1.16.1:

Config

package:
  exclude:
    - node_modules/**

Based on the docs it should work like this.

Using 1.15.3

Archive is ~22kb.

$ > yarn add serverless@1.15.3
$ > $(npm bin)/sls version && \
    $(npm bin)/sls package && \
    ls -ahl .serverless/sls-example.zip

1.15.3

Serverless: Packaging service...

-rw-r--r--  1 sbstjn  staff    22K Jun 27 21:58 .serverless/sls-example.zip

Using 1.16.1

Archive is ~7mb

$ > yarn add serverless@1.16.1
$ > $(npm bin)/sls version && \
    $(npm bin)/sls package && \
    ls -ahl .serverless/sls-example.zip

1.16.1

Serverless: Packaging service...

-rw-r--r--  1 sbstjn  staff   6.7M Jun 27 22:00 .serverless/sls-example.zip

NPM Dependencies

After moving the serverless package from dependencies to devDependencies in my package.json, the archive has 22kb using 1.16.1 as well.

22kb

{
  "devDependencies": {
    "serverless": "1.16.1"
  }
}

7mb

{
  "dependencies": {
    "serverless": "1.16.1"
  }
}

Expectation

I expected it does not matter if packages are in dependencies or devDependecies when using package/exclude in my configuration to exclude the node_modules folder.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions