You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/bundler/html.md
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -206,6 +206,38 @@ Each call to `console.log` or `console.error` will be broadcast to the terminal
206
206
207
207
Internally, this reuses the existing WebSocket connection from hot module reloading to send the logs.
208
208
209
+
### Edit files in the browser
210
+
211
+
Bun's frontend dev server has support for [Automatic Workspace Folders](https://chromium.googlesource.com/devtools/devtools-frontend/+/main/docs/ecosystem/automatic_workspace_folders.md) in Chrome DevTools, which lets you save edits to files in the browser.
212
+
213
+
{% image src="/images/bun-chromedevtools.gif" alt="Bun's frontend dev server has support for Automatic Workspace Folders in Chrome DevTools, which lets you save edits to files in the browser." /%}
214
+
215
+
{% details summary="How it works" %}
216
+
217
+
Bun's dev server automatically adds a `/.well-known/appspecific/com.chrome.devtools.json` route to the server.
218
+
219
+
This route returns a JSON object with the following shape:
220
+
221
+
```json
222
+
{
223
+
"workspace": {
224
+
"root": "/path/to/your/project",
225
+
"uuid": "a-unique-identifier-for-this-workspace"
226
+
}
227
+
}
228
+
```
229
+
230
+
For security reasons, this is only enabled when:
231
+
232
+
1. The request is coming from localhost, 127.0.0.1, or ::1.
233
+
2. Hot Module Reloading is enabled.
234
+
3. The `chromeDevToolsAutomaticWorkspaceFolders` flag is set to `true` or `undefined`.
235
+
4. There are no other routes that match the request.
236
+
237
+
You can disable this by passing `development: { chromeDevToolsAutomaticWorkspaceFolders: false }` in `Bun.serve`'s options.
0 commit comments