Load monaco editor from local installation

This commit is contained in:
naweiss 2026-05-11 06:26:08 +03:00
parent 176dbb79f3
commit 8d8e763724
2 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,7 @@
"format:check": "prettier --check \"src/**/*.{ts,tsx,css}\"",
"check": "npm run lint && npm run format:check",
"preview": "vite preview",
"postinstall": "mkdir -p public/monaco && cp -r node_modules/monaco-editor/min/vs public/monaco/vs",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
@ -28,6 +29,7 @@
"dependencies": {
"@google/genai": "^0.6.0",
"@monaco-editor/react": "^4.7.0",
"monaco-editor": "0.55.1",
"@types/react-syntax-highlighter": "^15.5.13",
"@wokwi/elements": "1.9.2",
"@xterm/addon-fit": "^0.11.0",

View File

@ -1,4 +1,5 @@
import { createRoot } from 'react-dom/client';
import { loader } from '@monaco-editor/react';
import './index.css';
// Side-effect import: initialises i18next BEFORE any component renders so
// useTranslation() always resolves against a live instance. Must come
@ -18,6 +19,9 @@ import './components/velxio-components/Bmp280Element';
import './components/velxio-components/EPaperElement';
import App from './App.tsx';
// Configure monaco-editor for offline use via local static assets
loader.config({ paths: { vs: '/monaco/vs' } });
createRoot(document.getElementById('root')!).render(<App />);
// Optional pro overlay. The `@pro` import resolves to a no-op stub in the