Skip to content

Commit 902e3af

Browse files
chore(wrangler): use the unenv preset from @cloudflare/unenv-preset (#7720)
Co-authored-by: Pete Bacon Darwin <[email protected]>
1 parent 8faf2c0 commit 902e3af

File tree

5 files changed

+29
-4
lines changed

5 files changed

+29
-4
lines changed

.changeset/cuddly-pets-smell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
chore(wrangler): use the unenv preset from `@cloudflare/unenv-preset`

packages/wrangler/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
},
7171
"dependencies": {
7272
"@cloudflare/kv-asset-handler": "workspace:*",
73+
"@cloudflare/unenv-preset": "1.x",
7374
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
7475
"@esbuild-plugins/node-modules-polyfill": "0.2.2",
7576
"blake3-wasm": "2.1.5",

packages/wrangler/scripts/deps.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ export const EXTERNAL_DEPENDENCIES = [
2121
// @cloudflare/workers-types is an optional peer dependency of wrangler, so users can
2222
// get the types by installing the package (to what version they prefer) themselves
2323
"@cloudflare/workers-types",
24-
25-
// unenv must be external because it contains unenv/runtime code which needs to be resolved
26-
// and read when we are bundling the worker application
24+
// `@cloudflare/unenv-preset` and `unenv` must be external because they contain code
25+
// which needs to be resolved and read when we are bundling the worker application
26+
"@cloudflare/unenv-preset",
2727
"unenv",
2828

2929
// path-to-regexp must be external because it contains runtime code which needs to be resolved

packages/wrangler/src/deployment-bundle/esbuild-plugins/hybrid-nodejs-compat.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { builtinModules } from "node:module";
22
import nodePath from "node:path";
3+
import { cloudflare } from "@cloudflare/unenv-preset";
34
import dedent from "ts-dedent";
4-
import { cloudflare, defineEnv } from "unenv";
5+
import { defineEnv } from "unenv";
56
import { getBasePath } from "../../paths";
67
import type { Plugin, PluginBuild } from "esbuild";
78

pnpm-lock.yaml

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)