Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monaco firststep #45

Merged
merged 4 commits into from
Mar 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions js/monaco-editor/firststep/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
9 changes: 9 additions & 0 deletions js/monaco-editor/firststep/dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<script src="./main.bundle.js"></script>
</body>
</html>
16 changes: 16 additions & 0 deletions js/monaco-editor/firststep/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';

(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'
});