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
* Start of work on astroConfig.mode === 'server'
* Add tests and more
* adapter -> deploy in some places
* Add fallback for `adapter` config
* Update more tests
* Update image tests
* Fix clientAddress test
* Updates based on PR review
* Add a changeset
* Update integrations tests + readme
* Oops
* Remove old option
* Rename `mode` to `output`
* Update Node adapter test
* Update test
* fred pass
* fred pass
* fred pass
* fix test
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
This change introduces a new "output target" configuration option (`output`). Setting the output target lets you decide the format of your final build, either:
15
+
16
+
*`"static"` (default): A static site. Your final build will be a collection of static assets (HTML, CSS, JS) that you can deploy to any static site host.
17
+
*`"server"`: A dynamic server application. Your final build will be an application that will run in a hosted server environment, generating HTML dynamically for different requests.
18
+
19
+
If `output` is omitted from your config, the default value `"static"` will be used.
20
+
21
+
When using the `"server"` output target, you must also include a runtime adapter via the `adapter` configuration. An adapter will *adapt* your final build to run on the deployed platform of your choice (Netlify, Vercel, Node.js, Deno, etc).
22
+
23
+
To migrate: No action is required for most users. If you currently define an `adapter`, you will need to also add `output: '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:
* Deploy to your favorite server, serverless, or edge host with build adapters. Import one of our first-party adapters for [Netlify](https://docs.astro.build/en/guides/deploy/netlify/#adapter-for-ssredge), [Vercel](https://docs.astro.build/en/guides/deploy/vercel/#adapter-for-ssr), and more to engage Astro SSR.
434
+
*
435
+
* [See our Server-side Rendering guide](https://docs.astro.build/en/guides/server-side-rendering/) for more on SSR, and [our deployment guides](https://docs.astro.build/en/guides/deploy/) for a complete list of hosts.
436
+
*
437
+
* ```js
438
+
* import netlify from '@astrojs/netlify/functions';
439
+
* {
440
+
* // Example: Build for Netlify serverless deployment
441
+
* adapter: netlify(),
442
+
* }
443
+
* ```
444
+
*/
445
+
adapter?: AstroIntegration;
446
+
447
+
/**
448
+
* @docs
449
+
* @name output
450
+
* @type {('static' | 'server')}
451
+
* @default `'static'`
452
+
* @see adapter
453
+
* @description
454
+
*
455
+
* Specifies the output target for builds.
456
+
*
457
+
* - 'static' - Building a static site to be deploy to any static host.
458
+
* - 'server' - Building an app to be deployed to a host supporting SSR (server-side rendering).
* Deploy to your favorite server, serverless, or edge host with build adapters. Import one of our first-party adapters for [Netlify](https://docs.astro.build/en/guides/deploy/netlify/#adapter-for-ssredge), [Vercel](https://docs.astro.build/en/guides/deploy/vercel/#adapter-for-ssr), and more to engage Astro SSR.
616
-
*
617
-
* [See our Server-side Rendering guide](https://docs.astro.build/en/guides/server-side-rendering/) for more on SSR, and [our deployment guides](https://docs.astro.build/en/guides/deploy/) for a complete list of hosts.
618
-
*
619
-
* ```js
620
-
* import netlify from '@astrojs/netlify/functions';
621
-
* {
622
-
* // Example: Build for Netlify serverless deployment
0 commit comments