Exclude dev dependencies from Node.js runtime package
Author: alekbarszczewskiCreated Feb 28, 2018Updated Nov 24, 2022
LabelsUXFeature Request
Prerequisites
- I am running the latest version. (
up upgrade) - I searched to see if the issue already exists.
- I inspected the verbose debug output with the
-v, --verboseflag. - Are you an Up Pro subscriber?
Description
I am getting Error: building: building: zip contents is 269 MB, exceeding Lambda's limit of 262 MB because my devDependencies in node_modules (Node.js project) are included in a zip file. I have quite a lot of them so putting them manually to .upignore is not convenient. Would be nice if there was an option to automatically exclude devDependencies from Lambda zip package. I know that serverless.js does this automatically when building Lambda package(s).
For example here is a list of my dev dependencies:
"@babel/cli": "^7.0.0-beta.32",
"@babel/core": "^7.0.0-beta.32",
"@babel/node": "^7.0.0-beta.32",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.32",
"@babel/plugin-proposal-decorators": "^7.0.0-beta.32",
"@babel/plugin-proposal-export-namespace": "^7.0.0-beta.32",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.32",
"@babel/plugin-transform-classes": "^7.0.0-beta.32",
"@babel/preset-env": "^7.0.0-beta.32",
"@babel/preset-flow": "^7.0.0-beta.32",
"@babel/register": "^7.0.0-beta.32",
"babel-eslint": "^8.0.2",
"babel-plugin-istanbul": "^4.1.5",
"babel-plugin-root-import": "^5.1.0",
"chai": "^4.1.2",
"cross-env": "^5.1.1",
"flow-bin": "^0.59.0",
"inquirer": "^5.1.0",
"mocha": "^4.0.1",
"nock": "^9.1.3",
"nyc": "^11.3.0",
"opn-cli": "^3.1.0",
"rimraf": "^2.6.2",
"sinon": "^4.1.2",
"standard": "^10.0.3",
"up": "^1.0.1"Source: apex/up