Packages

@astrojs/vercel

11.0.22 · 13 Nov 2026MIT790.2k / weekRepositoryHomepagenpmAtom feed

Your version

169 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 5.x
  2. 5.1.0

    24 Oct 2023
    • You 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

  3. 5.0.2

    5 Oct 2023
    • Add provenance statement when publishing the library from CI

  4. 5.0.1

    19 Sep 2023
    • Log only once in serverless adapter

  5. 5.0.0

    14 Sep 2023
    • Breaking

      Adds a configuration option devImageService to choose which of the built-in image services to use in development. Defaults to sharp.

    • Breaking

      Turn off functionPerRoute by default

      In the previous version of @astrojs/vercel, the default for functionPerRoute was changed to true. 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 functionPerRoute option is now back to defaulting to false. 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 the analytics property in astro.config.mjs in favor of speedInsights and webAnalytics.

      If you're using the analytics property, 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.

  6. 4.x
  7. 4.0.5

    8 Sep 2023
    • Fix Astro's domains and remotePatterns not being used by Vercel when using Vercel Image Optimization

  8. 4.0.4

    6 Sep 2023
    • Fix serverless function naming conflicts for routes with identical filenames but different directory structures

  9. 4.0.3

    1 Sep 2023
    • Cache result during bundling, to speed up the process of multiple functions;

    • Fix unnecessary warning about Sharp showing while building

  10. 4.0.2

    31 Aug 2023
    • Add astro feature map and adapter features to the static adapter. This will remove the warning emitted by Astro.

  11. 4.0.1

    31 Aug 2023
    • Update verbiage of Vercel warning

    • Add warning when functionPerRoute is set to true

  12. 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:assets such as enforcing alt, no CLS etc to users

  13. 3.x
  14. 3.8.2

    18 Aug 2023
    • Update image support to work with latest version of Astro

  15. 3.8.1

    11 Aug 2023
    • Prevent Vercel NFT from scanning /dev

  16. 3.8.0

    3 Aug 2023
    • Add cache headers to assets in Vercel adapter

  17. 3.7.5

    1 Aug 2023
    • Improve 404 behavior for serverless and edge

  18. 3.7.4

    21 Jul 2023
    • The vercel adapter now Warns when using a deprecated version of Node, and switches to 18 when using an unsupported version.

  19. 3.7.3

    18 Jul 2023
    • Fix build error when passing includeFiles

  20. 3.7.2

    14 Jul 2023
    • Fix critical build regression. @vercel/nft is excluded from the bundle automatically.

  21. 3.7.1

    13 Jul 2023
    • Improve file detection of the middleware file handler

  22. 3.7.0

    6 Jul 2023
    • Support for Vercel Edge Middleware via Astro middleware.

      When a project uses the new option Astro build.excludeMiddleware, the
      @astrojs/vercel/serverless adapter will automatically create a Vercel Edge Middleware
      that will automatically communicate with the Astro Middleware.

      Check the documentation for more details.

  23. 3.6.0

    3 Jul 2023
    • 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,
        },
      });
  24. 3.5.1

    27 Jun 2023
    • Fix redirects for root page when using trailingSlash: "always"

  25. 3.5.0

    6 Jun 2023
    • 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.

    • Unflags support for output: 'hybrid' mode, which enables pre-rendering by default. The additional experimental.hybridOutput flag can be safely removed from your configuration.

  26. 3.4.1

    30 May 2023
    • Fix imagesConfig being wrongly spelt as imageConfig in the README

  27. 3.4.0

    18 May 2023
    • Add edge-light and worker import condition for worker bundling

    • 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 = false to 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>
  28. 3.3.0

    2 May 2023
    • Add support for using the Vercel Image Optimization API through astro:assets

  29. 3.2.5

    25 Apr 2023
    • Refactor static adapter to use updateConfig method

  30. 3.2.4

    14 Apr 2023
    • Fix vercel edge private environment variables usage

    • Fix warning syntax in README

  31. 3.2.3

    10 Apr 2023
    • Revert change to environment variable

  32. 3.2.2

    5 Apr 2023
    • Fix vercel analytics id not being set

  33. 3.2.1

    13 Mar 2023
    • Add back support for Astro.clientAddress

  34. 3.2.0

    7 Mar 2023
    • Updated compilation settings to disable downlevelling for Node 14

  35. 3.1.4

    2 Mar 2023
    • Fixed undici-related bug

  36. 3.1.3

    23 Feb 2023
    • Use .mjs extension when building to support CJS environments

  37. 3.1.2

    16 Feb 2023
    • Don’t inject analytics script in dev

  38. 3.1.1

    9 Feb 2023
    • Fix and improve Vercel adapter README

  39. 3.1.0

    8 Feb 2023
    • Add vercel analytics support

  40. 3.0.1

    2 Feb 2023
    • Added second build step through esbuild, to allow framework defined build (vite build) and target defined bundling (esbuilt step)

  41. 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:start backwards compatibility code

    • Breaking

      Make astro a peerDependency of integrations

      This marks astro as a peerDependency of several packages that are already getting major version bumps. This is so we can more properly track the dependency between them and what version of Astro they are being used with.

  42. 2.x
  43. 2.4.0

    27 Dec 2022
    • Ignore warnings when traced file fails to parse

  44. 2.3.6

    12 Dec 2022
    • Support node-fetch and Node 18 fetch

  45. 2.3.5

    6 Dec 2022
    • Updated request-transform methods

  46. 2.3.4

    16 Nov 2022
    • Allows @astrojs/image to be used in Vercel SSR

  47. 2.3.3

    31 Oct 2022
    • Fixes unknown error when using vercel/static

  48. 2.3.2

    26 Oct 2022
    • Edge adapter includes all the generated files (all files inside dist/) instead of only entry.mjs

  49. 2.3.1

    19 Oct 2022
  50. 2.3.0

    18 Oct 2022
    • Minify Edge Function output to save space

    • Added includeFiles and excludeFiles options

  51. 2.2.0

    13 Oct 2022
    • New 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), and serverEntry (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).

  52. 2.1.1

    10 Oct 2022
    • Upgraded @vercel/nft to 0.22.1

  53. 2.1.0

    29 Sep 2022
    • Adds the Astro.cookies API

      Astro.cookies is a new API for manipulating cookies in Astro components and API routes.

      In Astro components, the new Astro.cookies object 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.

  54. 2.0.1

    27 Sep 2022
    • 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.