-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
astro build environments #12872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v6
Are you sure you want to change the base?
astro build environments #12872
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
| Since v6, Astro is based on `vite` v7 and it heavily uses its [environment APIs](https://vite.dev/guide/api-environment). | ||
|
|
||
| Astro build environments: | ||
| - `ssr`: the classic and default `ssr` environment of `vite`. Astro uses this environment to build dynamic routes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also used for non-dynamic routes in dev.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it's worth having a small paragraph for dev? At line 1197 I mention build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the goal is to explain that Astro uses environments now I would probably explain it all together. If the goal is to explain how there's prerender as a special environment in the build, I would explain the reasoning for this documentation more. Like for example something like:
Astro inherits the environments Vite provides by default, `ssr` and `client`. Additionally there is the the `prerender` environment provided by Astro. Here's what each of these environments are used for:|
|
||
| Astro build environments: | ||
| - `ssr`: the classic and default `ssr` environment of `vite`. Astro uses this environment to build dynamic routes. | ||
| - `client`: the classic and default `client` environment of `vite`. Astro uses this environment to generate client assets, such as scripts, styles, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Calling this and ssr "classic" is a little confusing to me. I think maybe instead you are wanting to say that they are vite-defined or built-in or something to that effect.
| - `prerender`: an environment that is created to build static pages. | ||
|
|
||
|
|
||
| If your integrations rely on `vite` environments and the Astro build, you might want to optimise based on these environments provided. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would link to Vite's docs on environment (which imo aren't great but its what we have).
I might also mention that the primary thing you do with environment is apply config.
Description (required)
In v6 Astro has three environments during the build, one more compared to the classic
ssrandclientVite environments.This PR adds a new section to the integration APIs to cover these environments.
The relevant PR 14998 was merged in main
next