diff --git a/documentation/docs/20-core-concepts/40-page-options.md b/documentation/docs/20-core-concepts/40-page-options.md index 0ad0160bc438..732ec0d5a7db 100644 --- a/documentation/docs/20-core-concepts/40-page-options.md +++ b/documentation/docs/20-core-concepts/40-page-options.md @@ -35,6 +35,8 @@ export const prerender = 'auto'; The prerenderer will start at the root of your app and generate files for any prerenderable pages or `+server.js` routes it finds. Each page is scanned for `` elements that point to other pages that are candidates for prerendering — because of this, you generally don't need to specify which pages should be accessed. If you _do_ need to specify which pages should be accessed by the prerenderer, you can do so with the `entries` option in the [prerender configuration](/docs/configuration#prerender). +While prerendering, the value of `building` imported from [`$app/environment`](/docs/modules#$app-environment) will be `true`. + #### Prerendering server routes Unlike the other page options, `prerender` also applies to `+server.js` files. These files are _not_ affected from layouts, but will inherit default values from the pages that fetch data from them, if any. For example if a `+page.js` contains this `load` function... diff --git a/packages/kit/types/ambient.d.ts b/packages/kit/types/ambient.d.ts index 81433de9a7b0..6f8c3c77b348 100644 --- a/packages/kit/types/ambient.d.ts +++ b/packages/kit/types/ambient.d.ts @@ -77,7 +77,7 @@ declare module '$app/environment' { export const browser: boolean; /** - * SvelteKit analyses your app during the `build` step by running it. During this process, `building` is `true`. + * SvelteKit analyses your app during the `build` step by running it. During this process, `building` is `true`. This also applies during prerendering. */ export const building: boolean;