index.js 447 B

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