[next] Re-enable shared lambdas by default (#4757)

This re-enables the shared lambdas optimization by default and also adds additional tests to ensure that when a `now.json` or `vercel.json` contains either `routes` or `functions` configs the shared lambda optimization is disabled. 

Additional test deployments done:

- minimal `now.json` with `builds` config [deploy](https://shared-lambdas-tests-d646fsqju.vercel.app)
- `now.json` with `functions` config [deploy](https://shared-lambdas-tests-ahnuosp4s.vercel.app)
- `now.json` with `routes` config [deploy](https://shared-lambdas-tests-gulam3jda.vercel.app)
- minimal `vercel.json` with `builds` config [deploy](https://shared-lambdas-tests-7ic7wzirs.vercel.app)
- `vercel.json` with `functions` config [deploy](https://shared-lambdas-tests-7ic7wzirs.vercel.app)
- `vercel.json` with `routes` config [deploy](https://shared-lambdas-tests-rja2391tq.vercel.app)
This commit is contained in:
JJ Kasper
2020-07-01 14:44:09 -05:00
committed by GitHub
parent b29db2fd1d
commit e0ec6c792b
46 changed files with 183 additions and 1162 deletions

View File

@@ -5,9 +5,11 @@ const _fetch = require('node-fetch');
const fetch = require('./fetch-retry.js');
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
async function nowDeploy(bodies, randomness) {
async function nowDeploy(bodies, randomness, uploadNowJson) {
const files = Object.keys(bodies)
.filter(n => n !== 'vercel.json' && n !== 'now.json')
.filter(n =>
uploadNowJson ? true : n !== 'vercel.json' && n !== 'now.json'
)
.map(n => ({
sha: digestOfFile(bodies[n]),
size: bodies[n].length,