You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
Reacted by Brian Neisler, Koji Nakayama, GA7, Ugaso and rowan
After upgrading to 1.16.1 from 1.14.0, I also noticed this ballooning in size of our zip files. It turns out that every node_modules directory in my service is being included in the zip file for every single function.
Our global package settings are set like so:
package:
individually: true
exclude:
- '**/*'
Each function then re-includes its code.
With 1.16.1, all node_modules directories from every function in my service is being included in every zip file, despite the exclude filter above, and the fact that we are trying to package functions individually.
I tried setting excludeDevDependencies to false, but this didn't appear to have any effect.
We're currently working on a bug fix in #3889. We'll do a patch release once fixed.
The excludeDevDependencies config will be added in v1.17 which we're about to release today. That should give you a way to opt-out of this until it's fixed.
Activity
pmuens commentedon Jun 28, 2017
Nice catch @sbstjn! 👍
I'm pretty sure that this is related to #3737.
Could be that the exclusion patterns for the Node.js dev dependencies overwrite the ones which are set by
package.exclude. 🤔pmuens commentedon Jul 4, 2017
Thanks again for reporting @sbstjn 👍
We've just started a PR which will include a fix for this (will be updated frequently).
It can be found here: #3889.
ajkerr commentedon Jul 4, 2017
After upgrading to 1.16.1 from 1.14.0, I also noticed this ballooning in size of our zip files. It turns out that every node_modules directory in my service is being included in the zip file for every single function.
Our global package settings are set like so:
Each function then re-includes its code.
With 1.16.1, all node_modules directories from every function in my service is being included in every zip file, despite the exclude filter above, and the fact that we are trying to package functions individually.
I tried setting excludeDevDependencies to false, but this didn't appear to have any effect.
pmuens commentedon Jul 5, 2017
Thanks for commenting @ajkerr 👍
We're currently working on a bug fix in #3889. We'll do a patch release once fixed.
The
excludeDevDependenciesconfig will be added inv1.17which we're about to release today. That should give you a way to opt-out of this until it's fixed.