Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 32 additions & 6 deletions packages/cloudflare/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ You can use [`create-next-app`](https://nextjs.org/docs/pages/api-reference/cli/
- add the following `devDependencies` to the `package.json`:

```bash
npm add -D wrangler@latest @opennextjs/cloudflare
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why wrangler@latest but not @opennextjs/cloudflare@latest?

Copy link
Contributor Author

@dario-piotrowicz dario-piotrowicz Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I had the same exact thought!

I don't know, maybe because @opennextjs/cloudflare is still experimental?

I just kept this as it was already in the README 🤷

# or
pnpm add -D wrangler@latest @opennextjs/cloudflare
# or
yarn add -D wrangler@latest @opennextjs/cloudflare
# or
bun add -D wrangler@latest @opennextjs/cloudflare
```

- add a `wrangler.toml` at the root of your project
Expand All @@ -36,6 +42,12 @@ You can enable Incremental Static Regeneration ([ISR](https://nextjs.org/docs/ap

```bash
npx wrangler kv namespace create NEXT_CACHE_WORKERS_KV
# or
pnpm wrangler kv namespace create NEXT_CACHE_WORKERS_KV
# or
yarn wrangler kv namespace create NEXT_CACHE_WORKERS_KV
# or
bun wrangler kv namespace create NEXT_CACHE_WORKERS_KV
```

- Paste the snippet to your `wrangler.toml`:
Expand All @@ -60,13 +72,25 @@ Run the following commands to preview the production build of your application l
- build the app and adapt it for Cloudflare

```bash
pnpx cloudflare
npx cloudflare
# or
pnpm cloudflare
# or
yarn cloudflare
# or
bun cloudflare
```

- Preview the app in Wrangler

```bash
npx wrangler dev
# or
pnpm wrangler dev
# or
yarn wrangler dev
# or
bun wrangler dev
```

## Deploy your app
Expand All @@ -76,9 +100,11 @@ Deploy your application to production with the following:
- build the app and adapt it for Cloudflare

```bash
pnpx cloudflare
```

```bash
pnpm wrangler deploy
npx cloudflare && npx wrangler deploy
# or
pnpm cloudflare && pnpm wrangler deploy
# or
yarn cloudflare && yarn wrangler deploy
# or
bun cloudflare && bun wrangler deploy
```