mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-23 00:22:56 +01:00
Adding examples
Adding an example with the monaco webpack plugin
This commit is contained in:
parent
3ec5c9d2e3
commit
27b10e31fa
5 changed files with 6330 additions and 0 deletions
20
browser-esm-webpack-monaco-plugin/index.js
Normal file
20
browser-esm-webpack-monaco-plugin/index.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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'
|
||||
}
|
||||
);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue