monaco-editor/samples/browser-esm-webpack-monaco-plugin/index.js
ValeraS 213f1821ec tune(monaco-editor-webpack-plugin): replace editor.main.js
Replace editor.main.js with editor.api.js and requested features and languages
2023-08-28 23:19:10 +02:00

16 lines
422 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'
});