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
In your project root, create a [Wrangler configuration file](/workers/wrangler/configuration/) with the following content:
102
106
@@ -116,7 +120,7 @@ You can convert an existing Next.js application to run on Cloudflare
116
120
As shown above, you must enable the [`nodejs_compat` compatibility flag](/workers/runtime-apis/nodejs/)_and_ set your [compatibility date](/workers/configuration/compatibility-dates/) to `2024-09-23` or later for your Next.js app to work with @opennextjs/cloudflare.
117
121
:::
118
122
119
-
3.**Add a configuration file for OpenNext**
123
+
4.**Add a configuration file for OpenNext**
120
124
121
125
In your project root, create an OpenNext configuration file named `open-next.config.ts` with the following content:
122
126
@@ -130,7 +134,7 @@ You can convert an existing Next.js application to run on Cloudflare
130
134
`open-next.config.ts` is where you can configure the caching, see the [adapter documentation](https://opennext.js.org/cloudflare/caching) for more information
131
135
:::
132
136
133
-
4.**Update `package.json`**
137
+
5.**Update `package.json`**
134
138
135
139
You can add the following scripts to your `package.json`:
136
140
@@ -148,21 +152,21 @@ You can convert an existing Next.js application to run on Cloudflare
148
152
root of your project containing the types for the env.
149
153
</Details>
150
154
151
-
5.**Develop locally.**
155
+
6.**Develop locally.**
152
156
153
157
After creating your project, run the following command in your project directory to start a local development server.
154
158
The command uses the Next.js development server. It offers the best developer experience by quickly reloading your app after your source code is updated.
155
159
156
160
<PackageManagerstype="run"args="dev" />
157
161
158
-
6.**Test your site with the Cloudflare adapter.**
162
+
7.**Test your site with the Cloudflare adapter.**
159
163
160
164
The command used in the previous step uses the Next.js development server to offer a great developer experience.
161
165
However your application will run on Cloudflare Workers so you want to run your integration tests and verify that your application workers correctly in this environment.
162
166
163
167
<PackageManagerstype="run"args="preview" />
164
168
165
-
7.**Deploy your project.**
169
+
8.**Deploy your project.**
166
170
167
171
You can deploy your project to a [`*.workers.dev` subdomain](/workers/configuration/routing/workers-dev/) or a [custom domain](/workers/configuration/routing/custom-domains/) from your local machine or any CI/CD system (including [Workers Builds](/workers/ci-cd/#workers-builds)). Use the following command to build and deploy. If you're using a CI service, be sure to update your "deploy command" accordingly.
0 commit comments