You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 28, 2025. It is now read-only.
You can exclude everything. The plugin makes sure the page handlers are included in the artifacts.
86
86
87
-
## Next configuration
87
+
## Hosting static assets
88
+
89
+
If you don't want to manage uploading the next static assets yourself, like uploading them to a CDN, the plugin can do this for you by hosting the asset files on S3.
90
+
91
+
The easiest way is to use a [valid bucket URL](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro) in the `assetPrefix` field of your next configuration:
| assetPrefix _(Optional)_| When using a [valid bucket URL](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro) the plugin will create a new S3 Bucket using the parsed name. On deployment, static assets will be uploaded to the bucket provisioned. |
100
+
The plugin will create a new S3 Bucket using the parsed name. On deployment, static assets will be uploaded to the bucket provisioned.
101
+
102
+
Alternatively, if you just want the assets to get uploaded to S3, you can provide the bucket name via the plugin config:
103
+
104
+
```yml
105
+
# serverless.yml
106
+
plugins:
107
+
- serverless-nextjs-plugin
108
+
109
+
custom:
110
+
serverless-nextjs:
111
+
nextConfigDir: "./"
112
+
assetsBucketName: "your-bucket-name"
113
+
```
114
+
115
+
With this approach you could have a CloudFront distribution in front of the bucket and use a custom domain in the assetPrefix.
0 commit comments