Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Document the actual use of export --entry (#1085)
Browse files Browse the repository at this point in the history
* Document the actual use of `export --entry`

The option for `--entry` is mentioned in the docs, but the actual api for it is not mentioned. Now it is.

* Remove second example

* Some tweaks

Co-authored-by: pngwn <[email protected]>
  • Loading branch information
happycollision and pngwn authored Jul 31, 2020
1 parent 66622d5 commit a5a421f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion site/content/docs/10-exporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ You can also add a script to your package.json...

When you run `sapper export`, Sapper first builds a production version of your app, as though you had run `sapper build`, and copies the contents of your `static` folder to the destination. It then starts the server, and navigates to the root of your app. From there, it follows any `<a>` elements it finds, and captures any data served by the app.

Because of this, any pages you want to be included in the exported site must either be reachable by `<a>` elements or added to the `--entry` option of the `sapper export` command. Additionally, any non-page routes should be requested in `preload`, *not* in `onMount` or elsewhere.
Because of this, any pages you want to be included in the exported site must either be reachable by `<a>` elements or added to the `--entry` option of the `sapper export` command.

The `--entry` option expects a string of space-separated values. Examples:

```bash
sapper export --entry "some-page some-other-page"
```

Setting `--entry` overwrites any defaults. If you wish to add export entrypoints _in addition_ to `/` then make sure to add `/` as well or `sapper export` will not visit the index route.


### When not to export
Expand Down

0 comments on commit a5a421f

Please sign in to comment.