Skip to content

Commit 5b6c6be

Browse files
committed
Update README
1 parent 275dab0 commit 5b6c6be

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,15 @@ Roo Code is available on:
255255
```bash
256256
code --install-extension bin/roo-code-4.0.0.vsix
257257
```
258-
5. **Debug**:
258+
5. **Start the webview (Vite/React app with HMR)**:
259+
```bash
260+
npm run dev
261+
```
262+
6. **Debug**:
259263
- Press `F5` (or **Run****Start Debugging**) in VSCode to open a new session with Roo Code loaded.
260264

265+
Changes to the webview will appear immediately. Changes to the core extension will require a restart of the extension host.
266+
261267
We use [changesets](https://github.com/changesets/changesets) for versioning and publishing. Check our `CHANGELOG.md` for release notes.
262268

263269
---

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
"lint": "eslint src --ext ts && npm run lint --prefix webview-ui",
228228
"package": "npm run build:webview && npm run check-types && npm run lint && node esbuild.js --production",
229229
"pretest": "npm run compile-tests && npm run compile && npm run lint",
230-
"start:webview": "cd webview-ui && npm run start",
230+
"dev": "cd webview-ui && npm run dev",
231231
"test": "jest && npm run test:webview",
232232
"test:webview": "cd webview-ui && npm run test",
233233
"test:extension": "vscode-test",

src/core/webview/ClineProvider.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,9 @@ export class ClineProvider implements vscode.WebviewViewProvider {
281281
}
282282

283283
webviewView.webview.html =
284-
this.context.extensionMode === vscode.ExtensionMode.Production
285-
? this.getHtmlContent(webviewView.webview)
286-
: this.getHMRHtmlContent(webviewView.webview)
284+
this.context.extensionMode === vscode.ExtensionMode.Development
285+
? this.getHMRHtmlContent(webviewView.webview)
286+
: this.getHtmlContent(webviewView.webview)
287287

288288
// Sets up an event listener to listen for messages passed from the webview view context
289289
// and executes code based on the message that is recieved
@@ -424,10 +424,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
424424
const localServerUrl = `localhost:${localPort}`
425425
const scriptUri = `http://${localServerUrl}/${file}`
426426

427-
const reactRefreshHash = "sha256-YmMpkm5ow6h+lfI3ZRp0uys+EUCt6FOyLkJERkfVnTY="
428-
429427
const reactRefresh = /*html*/ `
430-
<script sha256="${reactRefreshHash}" nonce="${nonce}" type="module">
428+
<script nonce="${nonce}" type="module">
431429
import RefreshRuntime from "http://localhost:${localPort}/@react-refresh"
432430
RefreshRuntime.injectIntoGlobalHook(window)
433431
window.$RefreshReg$ = () => {}
@@ -441,7 +439,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
441439
`font-src ${webview.cspSource}`,
442440
`style-src ${webview.cspSource} 'unsafe-inline' https://* http://${localServerUrl} http://0.0.0.0:${localPort}`,
443441
`img-src ${webview.cspSource} data:`,
444-
`script-src 'unsafe-eval' https://* http://${localServerUrl} http://0.0.0.0:${localPort} '${reactRefreshHash}' 'nonce-${nonce}'`,
442+
`script-src 'unsafe-eval' https://* http://${localServerUrl} http://0.0.0.0:${localPort} 'nonce-${nonce}'`,
445443
`connect-src https://* ws://${localServerUrl} ws://0.0.0.0:${localPort} http://${localServerUrl} http://0.0.0.0:${localPort}`,
446444
]
447445

0 commit comments

Comments
 (0)