monaco-editor/browser-esm-webpack-monaco-plugin/index.js
atomicpages 27b10e31fa Adding examples
Adding an example with the monaco webpack plugin
2019-05-22 08:07:16 -07:00

20 lines
431 B
JavaScript

import * as monaco from "monaco-editor";
(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'
}
);