Skip to content

Commit 4b1bedc

Browse files
ToriLindsayrschristiandario-piotrowicz
authored andcommitted
recreated PR16235 - Migrate Preact docs from wmr to create-preact (#17226)
* docs: Migrate Preact docs from `wmr` to `create-preact` * Apply suggestions from code review * Update src/content/docs/pages/framework-guides/deploy-a-preact-site.mdx * Update src/content/docs/pages/framework-guides/deploy-a-preact-site.mdx Co-authored-by: Dario Piotrowicz <[email protected]> --------- Co-authored-by: Ryan Christian <[email protected]> Co-authored-by: Dario Piotrowicz <[email protected]>
1 parent d396ba6 commit 4b1bedc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/content/docs/pages/framework-guides/deploy-a-preact-site.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,23 @@ import { Render } from "~/components";
88
[Preact](https://preactjs.com) is a popular, open-source framework for building modern web applications. Preact can also be used as a lightweight alternative to React because the two share the same API and component model.
99

1010
In this guide, you will create a new Preact application and deploy it using Cloudflare Pages.
11-
You will use [`wmr`](https://github.com/preactjs/wmr), an all-in-one development tool built by the Preact team, to quickly generate an optimized web application.
11+
You will use [`create-preact`](https://github.com/preactjs/create-preact), a lightweight project scaffolding tool to set up a new Preact app in seconds.
1212

1313
## Setting up a new project
1414

1515
Create a new project by running the [`npm init`](https://docs.npmjs.com/cli/v6/commands/npm-init) command in your terminal, giving it a title:
1616

1717
```sh
18-
npm init wmr your-project-name
18+
npm init preact
1919
cd your-project-name
2020
```
2121

22+
:::note
23+
24+
During initialization, you can accept the `Prerender app (SSG)?` option to have `create-preact` scaffold your app to produce static HTML pages, along with their assets, for production builds. This option is perfect for Pages.
25+
26+
:::
27+
2228
<Render file="tutorials-before-you-start" />
2329

2430
<Render file="framework-guides/create-github-repository" />
@@ -50,12 +56,6 @@ After completing configuration, select **Save and Deploy**.
5056

5157
You will see your first deploy pipeline in progress. Pages installs all dependencies and builds the project as specified.
5258

53-
:::note
54-
55-
**Note:** You will notice that within the `package.json` file, the `"build"` script uses the `--prerender` flag. With this, `wmr` produces static HTML pages – along with their assets – which is perfect for Pages.
56-
57-
:::
58-
5959
After you have deployed your site, you will receive a unique subdomain for your project on `*.pages.dev`.
6060

6161
Cloudflare Pages will automatically rebuild your project and deploy it on every new pushed commit.

0 commit comments

Comments
 (0)