serverless / serverless/serverless
devDependencies are not excluded all of a sudden...
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.9k
- Forks
- 5.7k
- Avg merge
- 10h 7m
- Merged PRs (30d)
- 57
Description
Are you certain it's a bug?
- Yes, it looks like a bug
Is the issue caused by a plugin?
- It is not a plugin issue
Are you using the latest v3 release?
- Yes, I'm using the latest v3 release
Is there an existing issue for this?
- I have searched existing issues, it hasn't been reported yet
Issue description
I found the issue for devDependencies not being excluded for the parent directory issue, but we have our serverless.yml in the root, along with te node_modules.
We have had this working fine previously, and the deploy size of the Lambdas has been around 31 MB.
Now we hit 110 MB and the deploy fails as the unpackaged size exceeds 360 MB(!).
Extracting the ZIP I can see that all dependecises are there, e.g. serverless, aws-sdk, eslint etc.
What have I messed up?
Service configuration (serverless.yml) content
frameworkVersion: '3'
package:
individually: true
excludeDevDependencies: true
patterns:
- '!volume/**' # exclude any Localstack temporary files/directories
- '!coverage/**'
- '!db-data/**'
- '!.serverless/**'
- '!.vscode/**'
- '!test/**'
- '!aws/**'
- '!dist/**'
### Command name and used flags
sls deploy -s test
### Command output
```shell
The verbose logging shows it is excluding dependencise:
stage: test
Packaging
Excluding development dependencies for function "migrator"
Excluding development dependencies for function "create-access-key"
Excluding development dependencies for function "integrationInternal"
Excluding development dependencies for function "integrationExternal"
Excluding development dependencies for function "internalRoutes"
### Environment information
```shell
Framework Core: 3.38.0 (local)
Plugin: 7.2.2
SDK: 4.5.1
node v18.14.2 (npm v9.5.0)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing sls deploy -s test with the provided serverless.yml and inspect the verbose packaging output for the listed functions. Compare the generated ZIP contents and size with the expected exclusion of development dependencies; the issue is done when those dependencies are absent and deployment packaging succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, javascript, node.js
- Domain
- build-system, cloud, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100