Skip to content

Commit

Permalink
feat: load monaco from local
Browse files Browse the repository at this point in the history
  • Loading branch information
dubisdev committed Jul 9, 2023
1 parent 8b9d4bd commit 96ff5f7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/LoadPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@ import { LoadingDots } from "./LoadingDots"
import { useHashLocation } from "../hooks/useHashLocation"
import { init } from "@x-python/core";

import * as monaco from 'monaco-editor';
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
import { loader } from "@monaco-editor/react"

const LoadPage = () => {
const [_, navigate] = useHashLocation()
useEffect(() => {
self.MonacoEnvironment = {
getWorker(_) {
return new editorWorker();
},
};
loader.config({ monaco })
init()
.then(() => navigate("/app"))
}, [])
Expand Down

0 comments on commit 96ff5f7

Please # to comment.