Skip to content

Commit

Permalink
chore(wrangler): use the unenv preset from @cloudflare/unenv-preset
Browse files Browse the repository at this point in the history
Co-authored-by: Pete Bacon Darwin <[email protected]>
  • Loading branch information
vicb and petebacondarwin committed Jan 15, 2025
1 parent 713f4e8 commit 8523cbf
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/cuddly-pets-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

chore(wrangler): use the unenv preset from `@cloudflare/unenv-preset`
1 change: 1 addition & 0 deletions packages/wrangler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
},
"dependencies": {
"@cloudflare/kv-asset-handler": "workspace:*",
"@cloudflare/unenv-preset": "1.x",
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
"@esbuild-plugins/node-modules-polyfill": "0.2.2",
"blake3-wasm": "2.1.5",
Expand Down
6 changes: 3 additions & 3 deletions packages/wrangler/scripts/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export const EXTERNAL_DEPENDENCIES = [
// @cloudflare/workers-types is an optional peer dependency of wrangler, so users can
// get the types by installing the package (to what version they prefer) themselves
"@cloudflare/workers-types",

// unenv must be external because it contains unenv/runtime code which needs to be resolved
// and read when we are bundling the worker application
// `@cloudflare/unenv-preset` and `unenv` must be external because they contain code
// which needs to be resolved and read when we are bundling the worker application
"@cloudflare/unenv-preset",
"unenv",

// path-to-regexp must be external because it contains runtime code which needs to be resolved
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { builtinModules } from "node:module";
import nodePath from "node:path";
import { cloudflare } from "@cloudflare/unenv-preset";
import dedent from "ts-dedent";
import { cloudflare, defineEnv } from "unenv";
import { defineEnv } from "unenv";
import { getBasePath } from "../../paths";
import type { Plugin, PluginBuild } from "esbuild";

Expand Down
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8523cbf

Please sign in to comment.