title: Reduce the size of the node-modules zip sent by the serverless framework
body: <p>I am writing a few nodejs functions using <a href="https://serverless.com/" rel="noreferrer">the serverless framework</a>. The <code>package.json</code> file requires a few dependencies:</p>
  
  <pre><code>{
    "name": "adam-test-sls",
    "version": "0.1.0",
    "description": "Test package to play with sls/lambda",
    "main": "handler.js",
    "scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
    },
    "author": "Adam Matan &lt;adam@binaris.com&gt;",
    "license": "UNLICENSED",
    "dependencies": {
      "aws-sdk": "&gt;= 2.0.9",
      "json": "^9.0.6",
      "underscore": "^1.8.3",
      "uuid": "^3.1.0"
    },
    "devDependencies": {
      "eslint": "^4.2.0",
      "eslint-config-airbnb": "^15.0.2",
      "eslint-config-airbnb-base": "^11.2.0",
      "eslint-plugin-import": "^2.7.0"
    }
  }
  </code></pre>
  
  <p>The size of the <code>node-modules</code> directory is almost 50mb:</p>
  
  <pre><code># du -smc node_modules
  47  node_modules
  47  total
  </code></pre>
  
  <p>Deployment time is more than 35 seconds, given a zip size of ~9.5MB:</p>
  
  <pre><code># time serverless deploy function --function hello -v
  Serverless: Packaging function: hello...
  Serverless: Uploading function: hello (9.46 MB)...
  Serverless: Successfully deployed function: hello
  serverless deploy function --function hello -v  4.28s user 1.15s system 15% cpu 35.165 total
  </code></pre>
  
  <p>This is somewhat inefficient - I only change one file, but I have to pack all the unchanged dependencies whenever I make the slightest change.</p>
  
  <p><strong>Any idea how to reduce the zip size (perhaps removing devDependencies), or upload only the changed file?</strong></p>