Not excluding dev deps

spacetime looks great :slight_smile: … uh, oh … no typing support. That’s a problem.

unfortunately firebase is critical to what I’m doing but the amount of dead-code is shocking. I’ve already gotten google to accept some of my suggestions but I will need a few more hours just to put in the suggests for them.

I just experienced the same problem. serverless package works fine on my local machine (both windows and linux ubuntu create zip around 40m) but when trying to run it in AWS CodeBuild, my zip file pushed automatically to s3 is over the 50m lambda limit. Downloading/unzipping it I can see that all my devDependencies are in there. I tried images for node8 and node10 and both have same problem. If anyone needs a reproducible test case for this, codebuild should provide it.

Was this ever solved?
I have the same problem where the zip inflate to more than 60 MB
Including excludeDevDependencies: true actually makes the zip bigger (80 MB) and all of these packages (and their dependencies) are included in the created zip:
“devDependencies”: {
@babel/core”: “^7.11.4”,
@babel/plugin-proposal-class-properties”: “^7.10.4”,
@babel/plugin-transform-modules-commonjs”: “^7.10.4”,
“axios”: “^0.19.0”,
“dotenv”: “^8.2.0”,
“http-server”: “^0.11.1”,
“node-formatter”: “0.0.1”,
“serverless”: “^1.56.1”,
“serverless-domain-manager”: “^5.0.0”,
“serverless-dotenv-plugin”: “^3.0.0”,
“serverless-plugin-custom-domain”: “^2.0.4”,
“serverless-jest-plugin”: “^0.2.1”,
“serverless-offline”: “^5.12.0”,
“serverless-stack-output”: “^0.2.3”,
“wait-on”: “^3.3.0”
},

1 Like

Hey @yishayh, recently there has been a bugfix for excludeDevDependencies not working on the newest NPM v7. So it should work if you are on Macos or Linux using NPM v7.

Also, the team has just merged a bugfix I’ve PR’ed related to an issue with excludeDevDependencies not working on any Windows machine for quite some tome.
If you were running on Windows, it should be working now, just make sure to upgrade to at least serverless version 2.20.1.

Cheers!

Upgrading to NPM v7 solved this problem for me. Thanks!

I can’t believe it. Upgrading to NPM 7 really fixed the issue