Skip to content

Commit 6907264

Browse files
committed
feat: auto disable when built-in dev preset is detected
1 parent df870f4 commit 6907264

File tree

6 files changed

+3373
-2551
lines changed

6 files changed

+3373
-2551
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
This proof of concept module enables access to the Cloudflare runtime platform in the development server of [Nitro](https://nitro.unjs.io) and [Nuxt](https://nuxt.com) using the [new `getPlatformProxy` API](https://github.com/cloudflare/workers-sdk/pull/5002) exposed by [wrangler](https://developers.cloudflare.com/workers/wrangler/) and [miniflare](https://miniflare.dev/)
44

5-
> [!NOTE]
6-
> Nitro plans to introduce a new method to allow native dev presets, meaning you can natively run [miniflare](https://miniflare.dev/) as your development server without this module or a proxy in the future!
5+
> [!IMPORTANT]
6+
> As of Nitro >= 2.12 you don't need this module anymore. Please see [Dev Preset](https://nitro.build/deploy/providers/cloudflare#dev-preset) docs for more info.
77
88
## Usage
99

examples/nitro/nitro.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ import nitroCloudflareBindings from "nitro-cloudflare-dev";
22

33
// https://nitro.unjs.io/config
44
export default defineNitroConfig({
5-
modules: [nitroCloudflareBindings]
5+
compatibilityDate: "latest",
6+
preset: "cloudflare-module",
7+
modules: [nitroCloudflareBindings],
68
});

examples/nuxt/nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// https://nuxt.com/docs/api/configuration/nuxt-config
22
export default defineNuxtConfig({
3+
compatibilityDate: "latest",
34
modules: ["nitro-cloudflare-dev"],
4-
compatibilityDate: "2024-10-10",
55
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"h3": "^1.15.1",
5050
"jiti": "^2.4.2",
5151
"miniflare": "^3.20250224.0",
52-
"nitropack": "^2.11.2",
52+
"nitropack": "^2.12.0",
5353
"nuxt": "^3.15.4",
5454
"prettier": "^3.5.3",
5555
"typescript": "^5.8.2",

0 commit comments

Comments
 (0)