mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 09:20:10 +01:00
Adds vite esm example (#5094)
This commit is contained in:
parent
b62a81677f
commit
d38215cf6b
8 changed files with 1743 additions and 0 deletions
13
samples/browser-esm-vite/main.ts
Normal file
13
samples/browser-esm-vite/main.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import './style.css';
|
||||
import * as monaco from '../../src/editor/editor.main';
|
||||
|
||||
monaco.languages.register({ id: 'typescript' });
|
||||
|
||||
const tm = monaco.editor.createModel(`class Test {}`, 'typescript',
|
||||
monaco.Uri.parse('file:///main.ts'));
|
||||
|
||||
const editor = monaco.editor.create(document.getElementById('root')!, {
|
||||
model: tm,
|
||||
language: 'typescript',
|
||||
theme: 'vs-dark',
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue