@astrojs/vercel
11.0.22 · 13 Nov 2026MIT790.2k / weekRepositoryHomepagenpmAtom feed
169 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 5.x
5.1.0
24 Oct 2023You can now configure how long your functions can run before timing out.
export default defineConfig({ output: "server", adapter: vercel({ + maxDuration: 60 }), });Prevents the Vercel serverless adapter from generating static redirect pages in hybrid mode
Minor Changes
You can now configure how long your functions can run before timing out.
export default defineConfig({ output: "server", adapter: vercel({ + maxDuration: 60 }), });
Patch Changes
Prevents the Vercel serverless adapter from generating static redirect pages in hybrid mode
5.0.2
5 Oct 2023Add provenance statement when publishing the library from CI
Patch Changes
Add provenance statement when publishing the library from CI
5.0.1
19 Sep 2023Log only once in serverless adapter
Patch Changes
Log only once in serverless adapter
5.0.0
14 Sep 2023- Breaking
Adds a configuration option
devImageServiceto choose which of the built-in image services to use in development. Defaults tosharp. - Breaking
Turn off
functionPerRouteby defaultIn the previous version of
@astrojs/vercel, the default forfunctionPerRoutewas changed totrue. While this option has several advantages, if you're a free tier user you are likely to run into the limit of 12 functions per deployment. This will result in an error when you attempt to deploy.For this reason, the
functionPerRouteoption is now back to defaulting tofalse. It's still a useful option if you have a paid plan and have previously run into issues with your single function exceeding the size limits. Enable Vercel Speed Insights and Vercel Web Analytics individually.
Deprecates theanalyticsproperty inastro.config.mjsin favor ofspeedInsightsandwebAnalytics.If you're using the
analyticsproperty, you'll need to update your config to use the new properties:// astro.config.mjs export default defineConfig({ adapter: vercel({ - analytics: true, + webAnalytics: { + enabled: true + }, + speedInsights: { + enabled: true + } }) });Allow configuration of Web Analytics with all available configuration options.
Bumps @vercel/analytics package to the latest version.
Major Changes
- Breaking
Adds a configuration option
devImageServiceto choose which of the built-in image services to use in development. Defaults tosharp. - Breaking
Turn off
functionPerRouteby defaultIn the previous version of
@astrojs/vercel, the default forfunctionPerRoutewas changed totrue. While this option has several advantages, if you're a free tier user you are likely to run into the limit of 12 functions per deployment. This will result in an error when you attempt to deploy.For this reason, the
functionPerRouteoption is now back to defaulting tofalse. It's still a useful option if you have a paid plan and have previously run into issues with your single function exceeding the size limits.
Minor Changes
Enable Vercel Speed Insights and Vercel Web Analytics individually.
Deprecates theanalyticsproperty inastro.config.mjsin favor ofspeedInsightsandwebAnalytics.If you're using the
analyticsproperty, you'll need to update your config to use the new properties:// astro.config.mjs export default defineConfig({ adapter: vercel({ - analytics: true, + webAnalytics: { + enabled: true + }, + speedInsights: { + enabled: true + } }) });Allow configuration of Web Analytics with all available configuration options.
Bumps @vercel/analytics package to the latest version.
- 4.x
4.0.5
8 Sep 2023Fix Astro's
domainsandremotePatternsnot being used by Vercel when using Vercel Image Optimization
Patch Changes
Fix Astro's
domainsandremotePatternsnot being used by Vercel when using Vercel Image Optimization
4.0.4
6 Sep 2023Fix serverless function naming conflicts for routes with identical filenames but different directory structures
Patch Changes
Fix serverless function naming conflicts for routes with identical filenames but different directory structures
4.0.3
1 Sep 2023Cache result during bundling, to speed up the process of multiple functions;
Fix unnecessary warning about Sharp showing while building
Patch Changes
Cache result during bundling, to speed up the process of multiple functions;
Avoid creating multiple symbolic links of the dependencies when building the project with
funcitonPerRouteenabled;
Fix unnecessary warning about Sharp showing while building
4.0.2
31 Aug 2023Add astro feature map and adapter features to the static adapter. This will remove the warning emitted by Astro.
Patch Changes
Add astro feature map and adapter features to the static adapter. This will remove the warning emitted by Astro.
4.0.1
31 Aug 2023Update verbiage of Vercel warning
Add warning when
functionPerRouteis set totrue
Patch Changes
Update verbiage of Vercel warning
Add warning when
functionPerRouteis set totrue
4.0.0
30 Aug 2023- Breaking
Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.
- Breaking
Astro 3.0 Release Candidate
- Breaking
When using an adapter that supports neither Squoosh or Sharp, Astro will now automatically use an image service that does not support processing, but still provides the other benefits of
astro:assetssuch as enforcingalt, no CLS etc to users
Major Changes
- Breaking
Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.
- Breaking
Astro 3.0 Release Candidate
- Breaking
When using an adapter that supports neither Squoosh or Sharp, Astro will now automatically use an image service that does not support processing, but still provides the other benefits of
astro:assetssuch as enforcingalt, no CLS etc to users - Breaking
Remove the Vercel Edge adapter
@astrojs/vercel/serverlessnow supports Edge middleware, so a separate adapter for Edge itself (deploying your entire app to the edge) is no longer necessary. Please update your Astro config to reflect this change:// astro.config.mjs import { defineConfig } from 'astro/config'; - import vercel from '@astrojs/vercel/edge'; + import vercel from '@astrojs/vercel/serverless'; export default defineConfig({ output: 'server', adapter: vercel({ + edgeMiddleware: true }), });This adapter had several known limitations and compatibility issues that prevented many people from using it in production. To reduce maintenance costs and because we have a better story with Serveless + Edge Middleware, we are removing the Edge adapter.
- Breaking
Vercel adapter now defaults to
functionPerRoute.With this change,
@astrojs/vercel/serverlessnow splits each route into its own function. By doing this, the size of each function is reduced and startup time is faster.You can disable this option, which will cause the code to be bundled into a single function, by setting
functionPerRoutetofalse. - Breaking
Reduced the amount of polyfills provided by Astro. Astro will no longer provide (no-op) polyfills for several web apis such as HTMLElement, Image or Document. If you need access to those APIs on the server, we recommend using more proper polyfills available on npm.
Minor Changes
Introduced the concept of feature map. A feature map is a list of features that are built-in in Astro, and an Adapter
can tell Astro if it can support it.import { AstroIntegration } from './astro'; function myIntegration(): AstroIntegration { return { name: 'astro-awesome-list', // new feature map supportedAstroFeatures: { hybridOutput: 'experimental', staticOutput: 'stable', serverOutput: 'stable', assets: { supportKind: 'stable', isSharpCompatible: false, isSquooshCompatible: false, }, }, }; }- Deprecated
The
build.splitandbuild.excludeMiddlewareconfiguration options are deprecated and have been replaced by options in the adapter config.If your config includes the
build.excludeMiddlewareoption, replace it withedgeMiddlewarein your adapter options:import { defineConfig } from "astro/config"; import vercel from "@astrojs/vercel/serverless"; export default defineConfig({ build: { - excludeMiddleware: true }, adapter: vercel({ + edgeMiddleware: true }), });If your config includes the
build.splitoption, replace it withfunctionPerRoutein your adapter options:import { defineConfig } from "astro/config"; import vercel from "@astrojs/vercel/serverless"; export default defineConfig({ build: { - split: true }, adapter: vercel({ + functionPerRoute: true }), });
- 3.x
3.8.2
18 Aug 2023Update image support to work with latest version of Astro
Patch Changes
Update image support to work with latest version of Astro
3.8.1
11 Aug 2023Prevent Vercel NFT from scanning /dev
Patch Changes
Prevent Vercel NFT from scanning /dev
3.8.0
3 Aug 2023Add cache headers to assets in Vercel adapter
Minor Changes
Add cache headers to assets in Vercel adapter
3.7.5
1 Aug 2023Improve
404behavior forserverlessandedge
Patch Changes
Improve
404behavior forserverlessandedge
3.7.4
21 Jul 2023The vercel adapter now Warns when using a deprecated version of Node, and switches to 18 when using an unsupported version.
Patch Changes
The vercel adapter now Warns when using a deprecated version of Node, and switches to 18 when using an unsupported version.
3.7.3
18 Jul 2023Fix build error when passing
includeFiles
Patch Changes
Fix build error when passing
includeFiles
3.7.2
14 Jul 2023Fix critical build regression.
@vercel/nftis excluded from the bundle automatically.
3.7.1
13 Jul 2023Improve file detection of the middleware file handler
Patch Changes
Improve file detection of the middleware file handler
3.7.0
6 Jul 2023Support for Vercel Edge Middleware via Astro middleware.
When a project uses the new option Astro
build.excludeMiddleware, the@astrojs/vercel/serverlessadapter will automatically create a Vercel Edge Middleware
that will automatically communicate with the Astro Middleware.Check the documentation for more details.
Minor Changes
Support for Vercel Edge Middleware via Astro middleware.
When a project uses the new option Astro
build.excludeMiddleware, the@astrojs/vercel/serverlessadapter will automatically create a Vercel Edge Middleware
that will automatically communicate with the Astro Middleware.Check the documentation for more details.
3.6.0
3 Jul 2023Split support in Vercel Serverless
The Vercel adapter builds to a single function by default. Astro 2.7 added support for splitting your build into separate entry points per page. If you use this configuration the Vercel adapter will generate a separate function for each page. This can help reduce the size of each function so they are only bundling code used on that page.
// astro.config.mjs import { defineConfig } from 'astro/config'; import vercel from '@astrojs/vercel/serverless'; export default defineConfig({ output: 'server', adapter: vercel(), build: { split: true, }, });
Minor Changes
Split support in Vercel Serverless
The Vercel adapter builds to a single function by default. Astro 2.7 added support for splitting your build into separate entry points per page. If you use this configuration the Vercel adapter will generate a separate function for each page. This can help reduce the size of each function so they are only bundling code used on that page.
// astro.config.mjs import { defineConfig } from 'astro/config'; import vercel from '@astrojs/vercel/serverless'; export default defineConfig({ output: 'server', adapter: vercel(), build: { split: true, }, });
3.5.1
27 Jun 2023Fix redirects for root page when using
trailingSlash: "always"
Patch Changes
Fix redirects for root page when using
trailingSlash: "always"
3.5.0
6 Jun 2023Support for experimental redirects
This adds support for the redirects RFC in the Vercel adapter. No changes are necessary, simply use configured redirects and the adapter will output the vercel.json file with the configuration values.
Unflags support for
output: 'hybrid'mode, which enables pre-rendering by default. The additionalexperimental.hybridOutputflag can be safely removed from your configuration.
Minor Changes
Support for experimental redirects
This adds support for the redirects RFC in the Vercel adapter. No changes are necessary, simply use configured redirects and the adapter will output the vercel.json file with the configuration values.
Patch Changes
Unflags support for
output: 'hybrid'mode, which enables pre-rendering by default. The additionalexperimental.hybridOutputflag can be safely removed from your configuration.
3.4.1
30 May 2023Fix
imagesConfigbeing wrongly spelt asimageConfigin the README
Patch Changes
Fix
imagesConfigbeing wrongly spelt asimageConfigin the README
3.4.0
18 May 2023Add
edge-lightandworkerimport condition for worker bundlingCorrectly handle analytics id where present
Enable experimental support for hybrid SSR with pre-rendering enabled by default
astro.config.mjs
import { defineConfig } from 'astro/config'; export defaultdefineConfig({ output: 'hybrid', experimental: { hybridOutput: true, }, })Then add
export const prerender = falseto any page or endpoint you want to opt-out of pre-rendering.src/pages/contact.astro
--- export const prerender = false; if (Astro.request.method === 'POST') { // handle form submission } --- <form method="POST"> <input type="text" name="name" /> <input type="email" name="email" /> <button type="submit">Submit</button> </form>
Minor Changes
Add
edge-lightandworkerimport condition for worker bundling
Patch Changes
Correctly handle analytics id where present
Enable experimental support for hybrid SSR with pre-rendering enabled by default
astro.config.mjs
import { defineConfig } from 'astro/config'; export defaultdefineConfig({ output: 'hybrid', experimental: { hybridOutput: true, }, })Then add
export const prerender = falseto any page or endpoint you want to opt-out of pre-rendering.src/pages/contact.astro
--- export const prerender = false; if (Astro.request.method === 'POST') { // handle form submission } --- <form method="POST"> <input type="text" name="name" /> <input type="email" name="email" /> <button type="submit">Submit</button> </form>Add missing esbuild dependency
Always build edge/worker runtime with Vite
webworkerSSR targetSpecify
"files"field to only publish necessary files
3.3.0
2 May 2023Add support for using the Vercel Image Optimization API through
astro:assets
Minor Changes
Add support for using the Vercel Image Optimization API through
astro:assets
3.2.5
25 Apr 2023Refactor static adapter to use updateConfig method
Patch Changes
Refactor static adapter to use updateConfig method
3.2.4
14 Apr 2023Fix vercel edge private environment variables usage
Fix warning syntax in README
3.2.3
10 Apr 2023Revert change to environment variable
3.2.2
5 Apr 2023Fix vercel analytics id not being set
Patch Changes
Fix vercel analytics id not being set
3.2.1
13 Mar 2023Add back support for Astro.clientAddress
Patch Changes
Add back support for Astro.clientAddress
3.2.0
7 Mar 2023Updated compilation settings to disable downlevelling for Node 14
Minor Changes
Updated compilation settings to disable downlevelling for Node 14
3.1.4
2 Mar 2023Fixed undici-related bug
Patch Changes
Fixed undici-related bug
3.1.3
23 Feb 2023Use .mjs extension when building to support CJS environments
Patch Changes
Use .mjs extension when building to support CJS environments
3.1.2
16 Feb 2023Don’t inject analytics script in dev
Patch Changes
Don’t inject analytics script in dev
3.1.1
9 Feb 2023Fix and improve Vercel adapter README
Patch Changes
Fix and improve Vercel adapter README
3.1.0
8 Feb 2023Add vercel analytics support
Minor Changes
Add vercel analytics support
3.0.1
2 Feb 2023Added second build step through esbuild, to allow framework defined build (vite build) and target defined bundling (esbuilt step)
Patch Changes
Added second build step through esbuild, to allow framework defined build (vite build) and target defined bundling (esbuilt step)
3.0.0
24 Jan 2023- Breaking
Remove support for Node 14. Minimum supported Node version is now >=16.12.0
- Breaking
Remove
astro:build:startbackwards compatibility code - Breaking
Make astro a
peerDependencyof integrationsThis marks
astroas apeerDependencyof several packages that are already gettingmajorversion bumps. This is so we can more properly track the dependency between them and what version of Astro they are being used with.
Major Changes
- Breaking
Remove support for Node 14. Minimum supported Node version is now >=16.12.0
- Breaking
Remove
astro:build:startbackwards compatibility code - Breaking
Make astro a
peerDependencyof integrationsThis marks
astroas apeerDependencyof several packages that are already gettingmajorversion bumps. This is so we can more properly track the dependency between them and what version of Astro they are being used with.
- 2.x
2.4.0
27 Dec 2022Ignore warnings when traced file fails to parse
2.3.6
12 Dec 2022Support node-fetch and Node 18 fetch
2.3.5
6 Dec 2022Updated request-transform methods
2.3.4
16 Nov 2022Allows @astrojs/image to be used in Vercel SSR
2.3.3
31 Oct 2022Fixes unknown error when using vercel/static
Patch Changes
Fixes unknown error when using vercel/static
2.3.2
26 Oct 2022Edge adapter includes all the generated files (all files inside
dist/) instead of onlyentry.mjs
2.3.0
18 Oct 2022Minify Edge Function output to save space
Added
includeFilesandexcludeFilesoptions
2.2.0
13 Oct 2022New build configuration
The ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for
server(the server code for SSR),client(your client-side JavaScript and assets), andserverEntry(the name of the entrypoint server module). Here are the defaults:import { defineConfig } from 'astro/config'; export default defineConfig({ output: 'server', build: { server: './dist/server/', client: './dist/client/', serverEntry: 'entry.mjs', }, });These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site).
2.1.1
10 Oct 2022Upgraded @vercel/nft to 0.22.1
2.1.0
29 Sep 2022Adds the Astro.cookies API
Astro.cookiesis a new API for manipulating cookies in Astro components and API routes.In Astro components, the new
Astro.cookiesobject is a map-like object that allows you to get, set, delete, and check for a cookie's existence (has):--- type Prefs = { darkMode: boolean; }; Astro.cookies.set<Prefs>( 'prefs', { darkMode: true }, { expires: '1 month', } ); const prefs = Astro.cookies.get<Prefs>('prefs').json(); --- <body data-theme={prefs.darkMode ? 'dark' : 'light'}></body>Once you've set a cookie with Astro.cookies it will automatically be included in the outgoing response.
This API is also available with the same functionality in API routes:
export function post({ cookies }) { cookies.set('loggedIn', false); return new Response(null, { status: 302, headers: { Location: '/login', }, }); }See the RFC to learn more.
2.0.1
27 Sep 2022Set SSR target webworker
Patch Changes
Set SSR target webworker
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.