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
-`npm run build:worker`: Runs the [@opennextjs/cloudflare](https://www.npmjs.com/package/@opennextjs/cloudflare) adapter. This first builds your app by running the `build` script in your `package.json` (Next.js apps use `next build` by default), and then transforms the build output to a format that you can run locally using [Wrangler](https://developers.cloudflare.com/workers/wrangler/), and deploy to Cloudflare. The build command used by OpenNext can be overridden with the `buildCommand` option in your OpenNext config.
139
-
-`npm run dev:worker`: Takes the output generated by `build:worker` and runs it locally in [workerd](https://github.com/cloudflare/workerd), the open-source Workers Runtime, allowing you to run the app locally in the same environment that it will run in production. If you instead run `next dev`, your app will run in Node.js, which is a different JavaScript runtime from the Workers runtime, with differences in behavior and APIs.
140
-
-`npm run preview`: Runs `build:worker` and then `dev:worker`, allowing you to quickly preview your app running locally in the Workers runtime, via a single command.
136
+
-`npm run preview`: Builds your app and serves it locally, allowing you to quickly preview your app running locally in the Workers runtime, via a single command.
141
137
-`npm run deploy`: Builds your app, and then deploys it to Cloudflare
142
138
-`cf-typegen`: Generates a `cloudflare-env.d.ts` file at the root of your project containing [the types for the `env`](https://developers.cloudflare.com/workers/wrangler/commands/#types).
143
139
@@ -193,15 +189,15 @@ export default nextConfig;
193
189
After having added the `initOpenNextCloudflareForDev()` call in your Next.js configuration file, you will be able, during local
194
190
development, to access in any of your server code, local versions of Cloudflare bindings as indicated in the [bindings documentation](./bindings).
195
191
196
-
In step 3, we also added the `npm run preview:worker`, which allows you to quickly preview your app running locally in the Workers runtime,
192
+
In step 3, we also added the `npm run preview`, which allows you to quickly preview your app running locally in the Workers runtime,
197
193
rather than in Node.js. This allows you to test changes in the same runtime as your app will run in when deployed to Cloudflare.
198
194
199
195
##### 12. Deploy to Cloudflare Workers
200
196
201
197
Either deploy via the command line:
202
198
203
199
```sh
204
-
npm run deploy:worker
200
+
npm run deploy
205
201
```
206
202
207
203
Or [connect a Github or Gitlab repository](https://developers.cloudflare.com/workers/ci-cd/), and Cloudflare will automatically build and deploy each pull request you merge to your production branch.
-[x][Image optimization](https://nextjs.org/docs/app/building-your-application/optimizing/images) (you can integrate Cloudflare Images with Next.js by following [this guide](https://developers.cloudflare.com/images/transform-images/integrate-with-frameworks/))
0 commit comments