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
{{ message }}
Repository navigation
Commit 549a89d
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: frontend/purestack.studio/guides/getting-started/purestack-cli.mdx
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ Add `content/about.mdx` with its own title and body. Then start the preview serv
66
66
yarn purestack serve --content ./content
67
67
```
68
68
69
-
Open the URL printed as `serving at`after the first build. With the default settings it is `http://127.0.0.1:4173/`. The server binds to `0.0.0.0` by default; pass `--host 127.0.0.1` if it should listen only on your machine. If `basePath` is set in `siteConfig.json`, the printed URL includes it.
69
+
Open the URL printed as `serving at`once shared setup finishes. Pages render as you open them. With the default settings the URL is `http://127.0.0.1:4173/`. The server binds to `0.0.0.0` by default; pass `--host 127.0.0.1` if it should listen only on your machine. If `basePath` is set in `siteConfig.json`, the printed URL includes it.
70
70
71
71
## Understand the content folder
72
72
@@ -97,7 +97,7 @@ Every build command requires `--content <dir>`. The path is resolved from the wo
97
97
| Command | Result | Output folder |
98
98
| --- | --- | --- |
99
99
|`build`| Generates the complete static site. |`outDir`|
100
-
|`serve`|Builds the site, starts an HTTP server, and watches content by default. |`outDir`|
100
+
|`serve`|Starts an HTTP server, renders pages on request, and watches content by default. |`outDir`|
101
101
|`publish`| Cleans and builds a release artifact. |`publishDir`|
102
102
103
103
Use `yarn purestack --help` or `yarn purestack help` to print the CLI's own usage summary. Options can be written as `--content ./content` or `--content=./content`.
The server uses port `4173` and host `0.0.0.0` unless you override them. It serves files from `outDir`, checks watched content changes, and reloads open pages after changes. Content changes are handled incrementally where possible; a change to `siteConfig.json`, to `purestack.config.ts`, or to a file the config imports causes a full rebuild so the new settings and plugins are applied.
124
+
The server uses port `4173` and host `0.0.0.0` unless you override them. By default, startup prepares routes, navigation, and shared page sections. Each page renders on its first request and is cached for later requests; static assets copy when requested. Watched edits invalidate affected pages so they render again on the next request, and open pages reload automatically. Changes to `siteConfig.json`, `purestack.config.ts`, or a file the config imports refresh shared setup and invalidate cached pages.
125
+
126
+
Use `--full-render` when you need every page, asset, and the complete search index generated before browsing. It runs one full build at startup, and site requests wait for that build to finish. After startup, watched edits use the same incremental invalidation and rendering on request as the default mode.
127
+
128
+
When search is enabled, the default mode builds its search index when a Pagefind asset is requested and includes only pages opened in the current session. `--full-render` starts with a complete search index; later changes are handled incrementally. `build` and `publish` always index the complete site.
124
129
125
130
These options belong to `serve`:
126
131
127
132
| Option | Effect |
128
133
| --- | --- |
129
134
|`--host <host>`| Listen on a particular interface, for example `127.0.0.1`. |
130
135
|`--port <port>`| Listen on a different port. |
131
-
|`--clean`| Remove `outDir` before the initial build. |
132
-
|`--no-watch`| Keep the server running without watching the content directory. The initial build still runs. |
133
-
|`--no-reload`| Keep watching and rebuilding, but do not inject the browser live reload script. |
136
+
|`--clean`| Remove `outDir` before setup and when config changes reset shared setup. |
137
+
|`--full-render`| Build every page, asset, and the complete search index once at startup. Watched edits remain incremental. |
138
+
|`--no-watch`| Keep the server running without watching the content directory. Pages still render on request, or all at startup with `--full-render`. |
139
+
|`--no-reload`| Keep watching and updating the site, but do not inject the browser live reload script. |
134
140
135
141
Watching and browser reload are separate. For example, `--no-reload` is useful if another browser tool manages refreshes. The server displays page build errors as diagnostic pages so you can correct the source and continue editing.
136
142
@@ -169,10 +175,8 @@ The home page stays at `dist/site/index.html`, but links and the development ser
169
175
| --- | --- |
170
176
|`Missing required --content <dir> option`| Pass `--content` to `build`, `serve`, or `publish`. |
171
177
|`Missing required siteConfig.json`| Check the path passed to `--content` and the file's exact name. |
172
-
|`Unknown option`| Run `yarn purestack --help`; `--host`, `--port`, `--no-watch`, and `--no-reload` apply only to `serve`. |
178
+
|`Unknown option`| Run `yarn purestack --help`; `--host`, `--port`, `--no-watch`, `--no-reload`, and `--full-render` apply only to `serve`. |
173
179
|`Could not bundle …purestack.config.ts`| Check the imports in `purestack.config.ts` and the files it imports; the message names the import that failed. |
174
180
|`Duplicate content routes detected`| Find two files that map to the same URL, such as `guide/index.md` and `guide/guide.mdx`. |
175
181
| A page or asset returns 404 under a subpath | Check `basePath`, the URL printed by `serve`, and the path at which your host serves the output folder. |
176
182
|`publish` fails while `serve` displayed an error page | Fix the page or asset error shown by the development server, then rerun `publish`. |
177
-
178
-
The checked-in [sample content](https://github.com/PureStackStudio/PureStack/tree/main/packages/ts-ssg/sample-content) is a larger working site. PureStack Studio adds its own skin, components, styles, and templates through a [plugin](https://github.com/PureStackStudio/PureStack/blob/main/frontend/studioPlugin.ts) listed in its [`purestack.config.ts`](https://github.com/PureStackStudio/PureStack/blob/main/frontend/purestack.studio/purestack.config.ts); `yarn frontend` runs `purestack serve` on that site.
0 commit comments