index.js 431 B

1234567891011121314151617181920
  1. import * as monaco from "monaco-editor";
  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(
  10. document.getElementById('root'),
  11. {
  12. value: `const foo = () => 0;`,
  13. language: 'javascript',
  14. theme: 'vs-dark'
  15. }
  16. );