mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Update webview-ui Vite config (#9493)
This commit is contained in:
parent
af021623cd
commit
204c71c62f
1 changed files with 18 additions and 10 deletions
|
|
@ -27,9 +27,9 @@ const wasmPlugin = (): Plugin => ({
|
|||
const wasmBinary = await import(id)
|
||||
|
||||
return `
|
||||
const wasmModule = new WebAssembly.Module(${wasmBinary.default});
|
||||
export default wasmModule;
|
||||
`
|
||||
const wasmModule = new WebAssembly.Module(${wasmBinary.default});
|
||||
export default wasmModule;
|
||||
`
|
||||
}
|
||||
},
|
||||
})
|
||||
|
|
@ -100,7 +100,13 @@ export default defineConfig(({ mode }) => {
|
|||
sourcemap: true,
|
||||
// Ensure source maps are properly included in the build
|
||||
minify: mode === "production" ? "esbuild" : false,
|
||||
// Use a single combined CSS bundle so both webviews share styles
|
||||
cssCodeSplit: false,
|
||||
rollupOptions: {
|
||||
input: {
|
||||
index: resolve(__dirname, "index.html"),
|
||||
"browser-panel": resolve(__dirname, "browser-panel.html"),
|
||||
},
|
||||
output: {
|
||||
entryFileNames: `assets/[name].js`,
|
||||
chunkFileNames: (chunkInfo) => {
|
||||
|
|
@ -111,16 +117,18 @@ export default defineConfig(({ mode }) => {
|
|||
return `assets/chunk-[hash].js`
|
||||
},
|
||||
assetFileNames: (assetInfo) => {
|
||||
if (
|
||||
assetInfo.name &&
|
||||
(assetInfo.name.endsWith(".woff2") ||
|
||||
assetInfo.name.endsWith(".woff") ||
|
||||
assetInfo.name.endsWith(".ttf"))
|
||||
) {
|
||||
const name = assetInfo.name || ""
|
||||
|
||||
// Force all CSS into a single predictable file used by both webviews
|
||||
if (name.endsWith(".css")) {
|
||||
return "assets/index.css"
|
||||
}
|
||||
|
||||
if (name.endsWith(".woff2") || name.endsWith(".woff") || name.endsWith(".ttf")) {
|
||||
return "assets/fonts/[name][extname]"
|
||||
}
|
||||
// Ensure source maps are included in the build
|
||||
if (assetInfo.name && assetInfo.name.endsWith(".map")) {
|
||||
if (name.endsWith(".map")) {
|
||||
return "assets/[name]"
|
||||
}
|
||||
return "assets/[name][extname]"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue