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
@@ -38,26 +39,7 @@ As shown above, you must enable the [`nodejs_compat` compatibility flag](https:/
38
39
39
40
`wrangler.toml` is where you configure your Worker and define what resources it can access via [bindings](/workers/runtime-apis/bindings/).
40
41
41
-
##### 3. Update `next.config.mjs`
42
-
43
-
Next, update the content in your `next.config.mjs` file.
44
-
45
-
```diff title="next.config.mjs"
46
-
+ import { setupDevPlatform } from '@cloudflare/next-on-pages/next-dev';
47
-
48
-
/** @type {import('next').NextConfig} */
49
-
const nextConfig = {};
50
-
51
-
+ if (process.env.NODE_ENV === 'development') {
52
-
+ await setupDevPlatform();
53
-
+ }
54
-
55
-
export default nextConfig;
56
-
```
57
-
58
-
These changes allows you to access [bindings](/pages/framework-guides/nextjs/ssr/bindings/) in local development.
59
-
60
-
##### 5. Update `package.json`
42
+
##### 3. Update `package.json`
61
43
62
44
Add the following to the scripts field of your `package.json` file:
63
45
@@ -73,12 +55,12 @@ Add the following to the scripts field of your `package.json` file:
73
55
-`npm run preview:worker`: Runs `build:worker` and then `preview:worker`, allowing you to quickly preview your app running locally in the Workers runtime, via a single command.
74
56
-`npm run deploy`: Builds your app, and then deploys it to Cloudflare
75
57
76
-
##### 6. Deploy to Cloudflare Workers
58
+
##### 4. Deploy to Cloudflare Workers
77
59
78
60
Either deploy via the command line:
79
61
80
62
```sh
81
63
npm run deploy
82
64
```
83
65
84
-
Or [connect a Github or Gitlab repository](https://develoers.cloudflare.com/workers/ci-cd/), and Cloudflare will automatically build and deploy each pull request you merge to your production branch.
66
+
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.
0 commit comments