Skip to content

Commit d38215c

Browse files
authored
Adds vite esm example (#5094)
1 parent b62a816 commit d38215c

File tree

8 files changed

+1743
-0
lines changed

8 files changed

+1743
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
src/**/*.js
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>browser-esm-vite</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script type="module" src="/main.ts"></script>
11+
</body>
12+
</html>

samples/browser-esm-vite/main.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import './style.css';
2+
import * as monaco from '../../src/editor/editor.main';
3+
4+
monaco.languages.register({ id: 'typescript' });
5+
6+
const tm = monaco.editor.createModel(`class Test {}`, 'typescript',
7+
monaco.Uri.parse('file:///main.ts'));
8+
9+
const editor = monaco.editor.create(document.getElementById('root')!, {
10+
model: tm,
11+
language: 'typescript',
12+
theme: 'vs-dark',
13+
});

0 commit comments

Comments
 (0)