Skip to content

Commit 0654708

Browse files
authored
Include vite in chrome devtools documentation
refs cloudflare/workers-sdk#8441 cloudflare/workers-sdk#7852
1 parent e030139 commit 0654708

File tree

1 file changed

+16
-12
lines changed
  • src/content/docs/workers/observability/dev-tools

1 file changed

+16
-12
lines changed

src/content/docs/workers/observability/dev-tools/index.mdx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,30 @@ meta:
88

99
## Using DevTools
1010

11-
When running your Worker locally using `wrangler dev`, you automatically have access to [Cloudflare's implementation](https://github.com/cloudflare/workers-sdk/tree/main/packages/chrome-devtools-patches) of [Chrome's DevTools](https://developer.chrome.com/docs/devtools/overview).
12-
DevTools help you debug and optimize your Workers.
11+
When running your Worker locally using the [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/) (`wrangler dev`) or using [Vite](https://vite.dev/) with the [Cloudflare Vite Plugin](https://developers.cloudflare.com/workers/vite-plugin/), you automatically have access to [Cloudflare's implementation](https://github.com/cloudflare/workers-sdk/tree/main/packages/chrome-devtools-patches) of [Chrome's DevTools](https://developer.chrome.com/docs/devtools/overview).
1312

14-
:::note
15-
You may have experience using Chrome's DevTools for frontend development. Notably, Worker DevTools are used for backend code and _not_ client-side JavaScript.
16-
:::
13+
You can use Chrome DevTools to:
14+
15+
- View logs directly in the Chrome console
16+
- [Debug code by setting breakpoints](/workers/observability/dev-tools/breakpoints/)
17+
- [Profile CPU usage](/workers/observability/dev-tools/cpu-usage/)
18+
- [Observe memory usage and debug memory leaks in your code that can cause out of memory (OOM) errors](/workers/observability/dev-tools/memory-usage/)
1719

1820
## Opening DevTools
1921

20-
To get started, run your Worker in development mode with `wrangler dev`, then open the DevTools in the browser by pressing the `D` key from your terminal. Now when you access this worker locally, it can be debugged and profiled with this DevTools instance.
22+
### Wrangler
23+
24+
- Run your Worker locally, by running `wrangler dev`
25+
- Press the `D` key from your terminal to open devtools in a browser tab
2126

22-
Alternatively, both the [Cloudflare Dashboard](https://dash.cloudflare.com/) and the [Worker's Playground](https://workers.cloudflare.com/playground) include DevTools in their UI.
27+
### Vite
2328

24-
## DevTool use cases
29+
- Run your worker locally, by running `vite`
30+
- In a new Chrome tab, open the debug URL that shows in your console, for example, `http://localhost:5173/__debug`
2531

26-
DevTools can be used in a variety of situations. For more information, see the documentation:
32+
### Dashboard Editor & Playground
2733

28-
- [Debugging code via breakpoints and logging](/workers/observability/dev-tools/breakpoints/)
29-
- [Profiling CPU usage](/workers/observability/dev-tools/cpu-usage/)
30-
- [Addressing out of memory (OOM) errors](/workers/observability/dev-tools/memory-usage/)
34+
Both [Cloudflare Dashboard](https://dash.cloudflare.com/) and the [Worker's Playground](https://workers.cloudflare.com/playground) include DevTools in the UI.
3135

3236
## Related resources
3337

0 commit comments

Comments
 (0)