Skip to content

Commit 4dc2dda

Browse files
committed
recreated PR16235 - change wmr to create-preact
1 parent 0f38f2f commit 4dc2dda

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,21 @@ 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 quickly generate a Preact app.
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 wmr preact
1919
cd your-project-name
2020
```
21+
:::note
22+
23+
During initialization, select the **Prerender app (SSG)?** option to allow `create-preact` to scaffold your app to produce static HTML pages, along with their assets, for production builds. This option is perfect for Pages.
24+
25+
:::
2126

2227
<Render file="tutorials-before-you-start" />
2328

@@ -50,12 +55,6 @@ After completing configuration, select **Save and Deploy**.
5055

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

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-
5958
After you have deployed your site, you will receive a unique subdomain for your project on `*.pages.dev`.
6059

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

0 commit comments

Comments
 (0)