Skip to content
This repository has been archived by the owner on Jan 28, 2025. It is now read-only.

Commit

Permalink
Merge branch 'master' into dphang/fix-next-static-override
Browse files Browse the repository at this point in the history
  • Loading branch information
dphang authored Jan 2, 2021
2 parents 632c5da + 6adaf00 commit 4d134b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
pr: ${{ github.event.inputs.pull_request_id }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ Is there a feature that you want but is not yet supported? Please open a [new is
- [x] [Base path](https://nextjs.org/docs/api-reference/next.config.js/basepath)
- [x] [Preview mode](https://nextjs.org/docs/advanced-features/preview-mode)
- [x] [Optional catch all routes](https://nextjs.org/docs/routing/dynamic-routes#optional-catch-all-routes)
- [x] [Redirects](https://nextjs.org/docs/api-reference/next.config.js/redirects). In latest alpha release (caveat: every route should be able to redirect except `_next/static/*` and `static/*`, since those cache behaviors do not have Lambda handlers attached to them). See [RFC](https://github.com/serverless-nextjs/serverless-next.js/issues/587) for updates.
- [x] [Rewrites](https://nextjs.org/docs/api-reference/next.config.js/rewrites). In latest alpha release (caveats: every route should be able to rewrite except `_next/static/*` and `static/*`, since those cache behaviors do not have Lambda handlers attached to them. [External URL rewrites](https://nextjs.org/docs/api-reference/next.config.js/rewrites#rewriting-to-an-external-url) are not yet implemented). See [RFC](https://github.com/serverless-nextjs/serverless-next.js/issues/587) for updates.
- [x] [Custom Headers](https://nextjs.org/docs/api-reference/next.config.js/headers). In latest alpha release (caveats: every route should be able to have custom headers except `_next/static/*` and `static/*`, since those cache behaviors do not have Lambda handlers attached to them. You also need to specify the S3 key as the source when redirecting any path mapped to an S3 file (see [PR](https://github.com/serverless-nextjs/serverless-next.js/pull/662) for more details). See [RFC](https://github.com/serverless-nextjs/serverless-next.js/issues/587) for updates.
- [x] [Redirects](https://nextjs.org/docs/api-reference/next.config.js/redirects). Caveat: every route should be able to redirect except `_next/static/*` and `static/*`, since those cache behaviors do not have Lambda handlers attached to them.
- [x] [Rewrites](https://nextjs.org/docs/api-reference/next.config.js/rewrites). Caveat: every route should be able to rewrite except `_next/static/*` and `static/*`, since those cache behaviors do not have Lambda handlers attached to them.
- [x] [Custom Headers](https://nextjs.org/docs/api-reference/next.config.js/headers). Caveats: every route should be able to have custom headers except `_next/static/*` and `static/*`, since those cache behaviors do not have Lambda handlers attached to them. You also need to specify the S3 key as the source when redirecting any path mapped to an S3 file (see [PR](https://github.com/serverless-nextjs/serverless-next.js/pull/662) for more details).
- [x] [Image Optimization](https://nextjs.org/docs/basic-features/image-optimization) Available in the latest 1.19 alpha version. Please try it out and let us know if there are any bugs.
- [ ] [Next.js 10 Features](https://nextjs.org/blog/next-10). A few issues such as https://github.com/serverless-nextjs/serverless-next.js/issues/721 are in progress, aiming for 1.19 release.

Expand Down Expand Up @@ -388,7 +388,7 @@ The exhaustive list of AWS actions required for a deployment:

### Lambda At Edge Configuration

Both **default** and **api** edge lambdas will be assigned 512mb of memory by default. This value can be altered by assigning a number to the `memory` input
The **default**, **api**, and **image** (for Next.js Image Optimization) edge lambdas will be assigned 512mb of memory by default. This value can be altered by assigning a number to the `memory` input

```yml
# serverless.yml
Expand All @@ -399,7 +399,7 @@ myNextApplication:
memory: 1024
```

Values for **default** and **api** lambdas can be separately defined by assigning `memory` to an object like so:
Values for **default**, **api**, and **image** lambdas can be separately defined by assigning `memory` to an object like so:

```yml
# serverless.yml
Expand All @@ -410,6 +410,7 @@ myNextApplication:
memory:
defaultLambda: 1024
apiLambda: 2048
imageLambda: 2048
```

The same pattern can be followed for specifying the Node.js runtime (nodejs12.x by default):
Expand All @@ -423,6 +424,7 @@ myNextApplication:
runtime:
defaultLambda: "nodejs10.x"
apiLambda: "nodejs10.x"
imageLambda: "nodejs12.x" # Note that the sharp image library is built for NodeJS 12.x
```

Similarly, the timeout by default is 10 seconds. To customise you can:
Expand All @@ -436,11 +438,12 @@ myNextApplication:
timeout:
defaultLambda: 20
apiLambda: 15
imageLambda: 15
```

Note the maximum timeout allowed for Lambda@Edge is 30 seconds. See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-requirements-limits.html

You can also set a custom name for **default** and **api** lambdas - if not the default is set by the [aws-lambda serverless component](https://github.com/serverless-components/aws-lambda) to the resource id:
You can also set a custom name for **default**, **api**, and **image** lambdas - if not the default is set by the [aws-lambda serverless component](https://github.com/serverless-components/aws-lambda) to the resource id:

```yml
# serverless.yml
Expand All @@ -451,6 +454,7 @@ myNextApplication:
name:
defaultLambda: fooDefaultLambda
apiLambda: fooApiLambda
imageLambda: fooImageLambda
```

### Architecture
Expand Down

0 comments on commit 4d134b0

Please sign in to comment.