Skip to content

Commit 4371576

Browse files
authored
Replace Bun with Npm
1 parent c9b6dc0 commit 4371576

File tree

1 file changed

+11
-11
lines changed
  • src/content/docs/workers/tutorials/generate-dynamic-og-images-using-workers

1 file changed

+11
-11
lines changed

src/content/docs/workers/tutorials/generate-dynamic-og-images-using-workers/index.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ graph TD
7777

7878
<Render file="prereqs" product="workers" />
7979

80-
3. Install [Bun](https://bun.sh/) on your machine.
80+
1. Install [Nodejs](https://nodejs.org/en) on your machine.
8181

8282
You should also have:
8383

@@ -91,7 +91,7 @@ Create a new Cloudflare Workers project using the Hono framework:
9191
<PackageManagers
9292
type="create"
9393
pkg="cloudflare@latest"
94-
args="og-image-generator --template cloudflare-workers --pm bun"
94+
args="og-image-generator --template cloudflare-workers --pm npm"
9595
/>
9696

9797
Navigate to the project directory:
@@ -104,32 +104,32 @@ cd og-image-generator
104104

105105
Add the necessary packages to your project:
106106

107-
<Tabs> <TabItem label="bun">
107+
<Tabs> <TabItem label="npm">
108108

109109
```sh
110-
bun add @cloudflare/pages-plugin-vercel-og autoprefixer postcss-cli react react-dom tailwindcss
111-
bun add -d @cloudflare/workers-types @types/bun @types/react @types/react-dom @vercel/og wrangler
110+
npm add @cloudflare/pages-plugin-vercel-og autoprefixer postcss-cli react react-dom tailwindcss
111+
npm add -d @cloudflare/workers-types @types/node @types/react @types/react-dom @vercel/og wrangler
112112
```
113113

114114
</TabItem> <TabItem label="npm">
115115

116116
```sh
117117
npm install @cloudflare/pages-plugin-vercel-og autoprefixer postcss-cli react react-dom tailwindcss
118-
npm install -d @cloudflare/workers-types @types/bun @types/react @types/react-dom @vercel/og
118+
npm install -d @cloudflare/workers-types @types/node @types/react @types/react-dom @vercel/og
119119
```
120120

121121
</TabItem> <TabItem label="yarn">
122122

123123
```sh
124124
yarn add @cloudflare/pages-plugin-vercel-og autoprefixer postcss-cli react react-dom tailwindcss
125-
yarn add -d @cloudflare/workers-types @types/bun @types/react @types/react-dom @vercel/og
125+
yarn add -d @cloudflare/workers-types @types/node @types/react @types/react-dom @vercel/og
126126
```
127127

128128
</TabItem> <TabItem label="pnpm">
129129

130130
```sh
131131
pnpm add @cloudflare/pages-plugin-vercel-og autoprefixer postcss-cli react react-dom tailwindcss
132-
pnpm add -d @cloudflare/workers-types @types/bun @types/react @types/react-dom @vercel/og
132+
pnpm add -d @cloudflare/workers-types @types/node @types/react @types/react-dom @vercel/og
133133
```
134134

135135
</TabItem> </Tabs>
@@ -169,7 +169,7 @@ Update the `tsconfig.json` file with the following configuration:
169169
"jsx": "react-jsx",
170170
"module": "ESNext",
171171
"moduleResolution": "bundler",
172-
"types": ["bun-types", "hono", "@cloudflare/workers-types/2023-07-01"],
172+
"types": ["node-types", "hono", "@cloudflare/workers-types/2023-07-01"],
173173
"resolveJsonModule": true,
174174
"esModuleInterop": true,
175175
"allowJs": true,
@@ -216,7 +216,7 @@ watch_dir = "public"
216216
```
217217
</WranglerConfig>
218218

219-
[The `nodejs_compat` flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag) enables runtime compatibility features required by the OG image generation library, even when using Bun. While we're using Bun as our development runtime, this flag ensures all necessary APIs are available in the Workers environment. The `assets` configuration maps your Worker's public directory, allowing direct access to static files like fonts, images, and favicons through URL paths (for example, `/fonts/Inter.ttf`, `/images/logo.png`).
219+
The [`nodejs_compat` flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag) enables runtime compatibility features required by the OG image generation library, ensuring all necessary APIs are available in the Workers environment. While we utilize a modern JavaScript runtime for development, this flag maintains consistency across environments. The `assets` configuration maps your Worker's public directory, allowing direct access to static files like fonts, images, and favicons through URL paths (for example, `/fonts/Inter.ttf`, `/images/logo.png`).
220220

221221
## 4. Configure font loading strategies
222222

@@ -553,7 +553,7 @@ With these definitions in place, you will get full TypeScript support and autoco
553553
Deploy the application to Cloudflare Workers:
554554

555555
```bash
556-
bun run deploy
556+
npm run deploy
557557
```
558558

559559
## Usage examples

0 commit comments

Comments
 (0)