You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
monaco-editor/browser-esm-webpack-monaco-.../index.js

21 lines
456 B
JavaScript

import * as monaco from "monaco-editor/esm/vs/editor/editor.api";
(function () {
// create div to avoid needing a HtmlWebpackPlugin template
const div = document.createElement('div');
div.id = 'root';
div.style = 'width:800px; height:600px; border:1px solid #ccc;';
document.body.appendChild(div);
})();
monaco.editor.create(
document.getElementById('root'),
{
value: `const foo = () => 0;`,
language: 'javascript',
theme: 'vs-dark'
}
);