Skip to content

Commit f6cf661

Browse files
committed
fix: update Monaco editor CSS import to use inline style and remove unused xterm dependencies
1 parent be9a442 commit f6cf661

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

packages/ui/lib/features/extensions/builtins/MonacoEditorSurface.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { StateStack } from "vscode-textmate";
1212
// from installed extensions, so the language-specific workers would just be
1313
// dead weight (each pulls in a megabyte-class language server).
1414
import EditorWorker from "monaco-editor/esm/vs/editor/editor.worker.js?worker&inline";
15-
import monacoCssUrl from "monaco-editor/min/vs/editor/editor.main.css?url";
15+
import monacoCssText from "monaco-editor/min/vs/editor/editor.main.css?inline";
1616
import onigWasmUrl from "vscode-oniguruma/release/onig.wasm?url";
1717
import { useEffect, useRef } from "react";
1818
import { useCommandRegistry } from "@dotdirfm/commands";
@@ -619,12 +619,11 @@ function createMonacoEditorExtensionApi(hostApi: DotDirGlobalApi, runtime?: Mona
619619
}
620620

621621
async function ensureMonacoReady(): Promise<void> {
622-
if (!monacoCssReady && typeof document !== "undefined" && document.head && monacoCssUrl) {
623-
const link = document.createElement("link");
624-
link.setAttribute("data-monaco", "true");
625-
link.rel = "stylesheet";
626-
link.href = monacoCssUrl;
627-
document.head.appendChild(link);
622+
if (!monacoCssReady && typeof document !== "undefined" && document.head && monacoCssText) {
623+
const style = document.createElement("style");
624+
style.setAttribute("data-monaco", "true");
625+
style.textContent = monacoCssText;
626+
document.head.appendChild(style);
628627
monacoCssReady = true;
629628
}
630629
if (monacoReady) return;

packages/ui/vite.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ export default defineConfig({
2424
"react-dom/client",
2525
"react-dom/server",
2626
"jotai",
27-
"@xterm/addon-fit",
28-
"@xterm/xterm",
29-
"@xterm/xterm/css/xterm.css",
3027
"cmdk",
3128
"jsonc-parser",
3229
"marked",

0 commit comments

Comments
 (0)