Skip to content

Commit

Permalink
[next] read regions from middleware-manifest output (#8629)
Browse files Browse the repository at this point in the history
### Related Issues

- Needs vercel/next.js#40881 for this to be
useful
- Resolves EC-238

### πŸ“‹ Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [ ] The code changed/added as part of this PR has been covered with
tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a
reviewer
- [ ] Issue from task tracker has a link to this PR

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
  • Loading branch information
3 people committed Sep 27, 2022
1 parent bf5cfa9 commit f674842
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/next/src/utils.ts
Expand Up @@ -2202,6 +2202,7 @@ interface BaseEdgeFunctionInfo {
page: string;
wasm?: { filePath: string; name: string }[];
assets?: { filePath: string; name: string }[];
regions?: 'auto' | string[] | 'all' | 'default';
}

interface EdgeFunctionInfoV1 extends BaseEdgeFunctionInfo {
Expand Down Expand Up @@ -2341,6 +2342,7 @@ export async function getMiddlewareBundle({
...wasmFiles,
...assetFiles,
},
regions: edgeFunction.regions,
entrypoint: 'index.js',
envVarsInUse: edgeFunction.env,
assets: (edgeFunction.assets ?? []).map(({ name }) => {
Expand Down

0 comments on commit f674842

Please sign in to comment.