Skip to content

Instantly share code, notes, and snippets.

Created March 15, 2023 04:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
<link rel="stylesheet" type="text/css" href=""/>
<h1>Hello World</h1>
<div id="container" style="width: 800px; height: 600px; border: 1px solid #ccc"></div>
<script type="module">
import * as monaco from '';
import editorWorker from "";
import jsonWorker from "";
self.MonacoEnvironment = {
getWorker: function (moduleId, label) {
console.dir({ moduleId, label });
if (label === 'editorWorkerService') {
return editorWorker();
} else if (label === "json") {
return jsonWorker();
let container = document.getElementById('container');
monaco.editor.create(container, {
value: JSON.stringify({hello: "world"}, null, 2),
language: 'json',
minimap: {
enabled: false,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment