@astrojs/netlify
8.2.14 · 13 Nov 2026MIT71.2k / weekRepositoryHomepagenpmAtom feed
151 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 3.x
3.0.2
25 Sep 2023Fix build failures because of CJS builds and top-level await
Patch Changes
Fix build failures because of CJS builds and top-level await
3.0.1
1 Sep 2023Update README
Patch Changes
Update README
3.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
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.
- Breaking
Remove the Netlify Edge adapter
@astrojs/netlify/functionsnow 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 netlify from '@astrojs/netlify/edge'; + import netlify from '@astrojs/netlify/functions'; export default defineConfig({ output: 'server', adapter: netlify({ + 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.
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 netlify from "@astrojs/netlify/functions"; export default defineConfig({ build: { - excludeMiddleware: true }, adapter: netlify({ + edgeMiddleware: true }), });If your config includes the
build.splitoption, replace it withfunctionPerRoutein your adapter options:import { defineConfig } from "astro/config"; import netlify from "@astrojs/netlify/functions"; export default defineConfig({ build: { - split: true }, adapter: netlify({ + functionPerRoute: true }), });
- 2.x
2.6.0
11 Aug 2023If you are using Netlify's On-demand Builders, you can now specify how long your pages should remain cached. By default, all pages will be rendered on first visit and reused on every subsequent visit until a redeploy. To set a custom revalidation time, call the
runtime.setBuildersTtl()local in either your frontmatter or middleware.--- import Layout from '../components/Layout.astro'; if (import.meta.env.PROD) { // revalidates every 45 seconds Astro.locals.runtime.setBuildersTtl(45); } --- <Layout title="Astro on Netlify"> {new Date(Date.now())} </Layout>
Minor Changes
If you are using Netlify's On-demand Builders, you can now specify how long your pages should remain cached. By default, all pages will be rendered on first visit and reused on every subsequent visit until a redeploy. To set a custom revalidation time, call the
runtime.setBuildersTtl()local in either your frontmatter or middleware.--- import Layout from '../components/Layout.astro'; if (import.meta.env.PROD) { // revalidates every 45 seconds Astro.locals.runtime.setBuildersTtl(45); } --- <Layout title="Astro on Netlify"> {new Date(Date.now())} </Layout>
2.5.2
1 Aug 2023Fix README GitHub search link
Improve
404behavior forserverlessandedge
Patch Changes
Fix README GitHub search link
Improve
404behavior forserverlessandedge
2.5.1
27 Jul 2023Prevent building .html file redirects in hybrid mode
Patch Changes
Prevent building .html file redirects in hybrid mode
2.5.0
19 Jul 2023When a project uses the new
build.excludeMiddlewareAstro config option, the@astrojs/netlify/functionsadapter will bundle your middleware to run in a Netlify Edge Function.See the Netlify adapter documentation for more details.
Minor Changes
When a project uses the new
build.excludeMiddlewareAstro config option, the@astrojs/netlify/functionsadapter will bundle your middleware to run in a Netlify Edge Function.See the Netlify adapter documentation for more details.
2.4.0
13 Jul 2023The Netlify 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 Netlify 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 netlify from '@astrojs/netlify/functions'; export default defineConfig({ output: 'server', adapter: netlify(), build: { split: true, }, });
Minor Changes
The Netlify 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 Netlify 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 netlify from '@astrojs/netlify/functions'; export default defineConfig({ output: 'server', adapter: netlify(), build: { split: true, }, });
2.3.0
6 Jun 2023Support for experimental redirects
This adds support for the redirects RFC in the Netlify adapter, including a new
@astrojs/netlify/staticadapter for static sites.No changes are necessary when using SSR. Simply use configured redirects and the adapter will update your
_redirectsfile.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 Netlify adapter, including a new
@astrojs/netlify/staticadapter for static sites.No changes are necessary when using SSR. Simply use configured redirects and the adapter will update your
_redirectsfile.
Patch Changes
Unflags support for
output: 'hybrid'mode, which enables pre-rendering by default. The additionalexperimental.hybridOutputflag can be safely removed from your configuration.
2.2.3
18 May 2023Enable 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>Specify
"files"field to only publish necessary files
Patch Changes
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>Specify
"files"field to only publish necessary files
2.2.2
10 Apr 2023No edge functions deployed to netlify
2.2.1
7 Apr 2023Use Deno API to set Astro.clientAddress in Netlify Edge
Patch Changes
Use Deno API to set Astro.clientAddress in Netlify Edge
2.2.0
7 Mar 2023Updated compilation settings to disable downlevelling for Node 14
Minor Changes
Updated compilation settings to disable downlevelling for Node 14
2.1.3
23 Feb 2023- Security
Updated Undici to 5.20.0. This fixes a security issue and handling of cookies in certain cases in dev
Use .mjs extension when building to support CJS environments
Patch Changes
- Security
Updated Undici to 5.20.0. This fixes a security issue and handling of cookies in certain cases in dev
Use .mjs extension when building to support CJS environments
2.1.2
7 Feb 2023Fix polyfills not being available in certain cases
Patch Changes
Fix polyfills not being available in certain cases
2.1.1
1 Feb 2023Fix Netlify Function regression
2.1.0
30 Jan 2023Add
buildersconfig option for Netlify On-demand Builders.
Minor Changes
Add
buildersconfig option for Netlify On-demand Builders.
2.0.0
24 Jan 2023- Breaking
& #5842
c4b0cb8bfThanks @wulinsheng123 and @natemoo-re! - Breaking Change: client assets are built to an_astrodirectory in the build output directory. Previously these were built to various locations, includingassets/,chunks/and the root of build output.You can control this location with the new
buildconfiguration option namedassets. - Breaking
Remove
astro:build:startbackwards compatibility code - Breaking
Make astro a peerDependency of integrations
This marks
astroas a peerDependency of 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
& #5842
c4b0cb8bfThanks @wulinsheng123 and @natemoo-re! - Breaking Change: client assets are built to an_astrodirectory in the build output directory. Previously these were built to various locations, includingassets/,chunks/and the root of build output.You can control this location with the new
buildconfiguration option namedassets. - Breaking
Remove
astro:build:startbackwards compatibility code - Breaking
Make astro a peerDependency of integrations
This marks
astroas a peerDependency of 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.
Patch Changes
Fix set-cookies not working in certain cases when using Node 18+
Support prerender in _redirects
Fix issue with prerendered pages when using
edge-functionsadapter
- 1.x
1.3.0
16 Dec 2022Introduces the experimental Prerender API.
Note
This API is not yet stable and is subject to possible breaking changes!Usage
1.2.2
8 Dec 2022Update esbuild dependency
1.2.1
8 Nov 2022Fix environment variables usage in edge functions
1.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).
1.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.
Add missing dependencies, support strict dependency installation (e.g. pnpm)
1.0.4
20 Sep 2022Fix processing of images in Netlify Functions
1.0.3
13 Sep 2022Fix route validation failures on Netlify Edge
1.0.2
31 Aug 2022Adding the
withastrokeyword to include the adapters on the Integrations Catalog
1.0.1
12 Aug 2022Adds 404 routing logic to Netlify redirects file
1.0.0
9 Aug 2022- Breaking
Astro v1.0 is out! Read the official announcement post.
No breaking changes. This package is now officially stable and compatible with
astro@1.0.0!
Major Changes
- Breaking
Astro v1.0 is out! Read the official announcement post.
No breaking changes. This package is now officially stable and compatible with
astro@1.0.0!
- 0.5.x
0.5.0
26 Jul 2022New
outputconfiguration optionThis change introduces a new "output target" configuration option (
output). Setting the output target lets you decide the format of your final build, either:If
outputis omitted from your config, the default value"static"will be used.When using the
"server"output target, you must also include a runtime adapter via theadapterconfiguration. An adapter will adapt your final build to run on the deployed platform of your choice (Netlify, Vercel, Node.js, Deno, etc).To migrate: No action is required for most users. If you currently define an
adapter, you will need to also addoutput: 'server'to your config file to make it explicit that you are building a server. Here is an example of what that change would look like for someone deploying to Netlify:import { defineConfig } from 'astro/config'; import netlify from '@astrojs/netlify/functions'; export default defineConfig({ adapter: netlify(), + output: 'server', });Support for 404 and 500 pages in SSR
Adds support for Astro.clientAddress
The new
Astro.clientAddressproperty allows you to get the IP address of the requested user.<div>Your address { Astro.clientAddress }</div>This property is only available when building for SSR, and only if the adapter you are using supports providing the IP address. If you attempt to access the property in a SSG app it will throw an error.
- 0.4.x
0.4.10
12 Jul 2022Integration README fixes
0.4.9
9 Jul 2022Small README fixes
Support adapters and third party packages
0.4.8
30 Jun 2022Update READMEs
0.4.7
28 Jun 2022Append shim to top of built file to avoid "can't read process of undefined" issues
0.4.6
22 Jun 2022Fix react dependencies to improve test reliability
0.4.5
21 Jun 2022"vpath" import error when building for netlify edge
0.4.4
16 Jun 2022Adds support for base64 encoded responses in Netlify Functions
0.4.3
7 Jun 2022Fixes Netlify Edge Function and Astro.glob
0.4.2
2 Jun 2022Alias
from 'astro'imports to'@astro/types'
Update Deno and Netlify integrations to handle vite.resolves.alias as an array
0.4.1
25 May 2022Only updates a dependency:@astrojs/webapi 0.12.0
0.4.0
17 May 2022Updating out directories for Netlify Functions
Change out directories on dist and serverEntry
- 0.3.x
0.3.4
12 May 2022Create redirects file for netlify edge adapter
0.3.3
26 Apr 2022Netlify Edge: Forward requests for static assets
0.3.2
21 Apr 2022Allows using React.lazy, Suspense in SSR and with hydration
0.3.1
19 Apr 2022Outputs manifest.json in correct folder for Netlify Edge Functions
0.3.0
19 Apr 2022Adds support for Netlify Edge Functions
- 0.2.x
0.2.3
13 Apr 2022Fixes setting multiple cookies with the Netlify adapter
0.2.2
12 Apr 2022Make Netlify adapter actually append redirects
0.2.1
11 Apr 2022No changes.
0.2.0
11 Apr 2022Improve the Netlify adapter:
Add human-readable error when a site is not provided in your astro.config
Fixes dynamic routes in the Netlify adapter
- 0.1.x
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.