Skip to content

Commit

Permalink
add notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Nov 22, 2022
1 parent b9d598c commit fcb9f50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions documentation/docs/20-core-concepts/40-page-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<a>` 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...
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/types/ambient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit fcb9f50

Please sign in to comment.