Skip to content

Commit 07612b0

Browse files
Merge pull request #4227 from Kilo-Org/catrielmuller/fix-vscode-webview
Fix vscode webview
2 parents ea87d82 + 652ddda commit 07612b0

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.changeset/tasty-insects-arrive.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"kilo-code": patch
3+
---
4+
5+
Fix VSCode webview assets

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/webview/WebViewManager.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,6 @@ class WebViewManager(var project: Project) : Disposable, ThemeChangeListener {
314314
fun updateWebViewHtml(data: WebviewHtmlUpdateData) {
315315
data.htmlContent = data.htmlContent.replace("/jetbrains/resources/kilocode/", "./")
316316
data.htmlContent = data.htmlContent.replace("<html lang=\"en\">", "<html lang=\"en\" style=\"background: var(--vscode-sideBar-background);\">")
317-
// Replace index.css/index.js with main.css/main.js to match actual build output
318-
data.htmlContent = data.htmlContent.replace("assets/index.css", "assets/main.css")
319-
data.htmlContent = data.htmlContent.replace("assets/index.js", "assets/main.js")
320317
val encodedState = getLatestWebView()?.state.toString().replace("\"", "\\\"")
321318
val mRst = """<script\s+nonce="([A-Za-z0-9]{32})">""".toRegex().find(data.htmlContent)
322319
val str = mRst?.value ?: ""

webview-ui/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default defineConfig(({ mode }) => {
121121
cssCodeSplit: true, // kilocode_change: enable CSS code splitting so CSS files are generated
122122
rollupOptions: {
123123
input: {
124-
main: resolve(__dirname, "index.html"),
124+
index: resolve(__dirname, "index.html"),
125125
"agent-manager": resolve(__dirname, "agent-manager.html"), // kilocode_change
126126
},
127127
external: ["vscode"], // kilocode_change: we inadvertently import vscode into the webview: @roo/modes => src/shared/modes => ../core/prompts/sections/custom-instructions

0 commit comments

Comments
 (0)