mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 11:35:40 +01:00
commit
779a88524d
6 changed files with 29 additions and 37 deletions
3
browser-esm-parcel/.gitignore
vendored
3
browser-esm-parcel/.gitignore
vendored
|
|
@ -1,3 +1,2 @@
|
|||
dist/*.js
|
||||
dist/*.css
|
||||
dist/
|
||||
.cache
|
||||
|
|
|
|||
18
browser-esm-parcel/dist/index.html
vendored
18
browser-esm-parcel/dist/index.html
vendored
|
|
@ -1,18 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
|
||||
<!-- Note - Parcel builds a single css file for required assets -->
|
||||
<link rel="stylesheet" href="index.css" />
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container" style="width:800px;height:600px;border:1px solid #ccc"></div>
|
||||
|
||||
<script src="index.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -18,8 +18,7 @@ To run this sample, you need to:
|
|||
|
||||
<pre>
|
||||
$/browser-esm-parcel> npm install .
|
||||
$/browser-esm-parcel> ./node_modules/.bin/parcel build node_modules/monaco-editor/esm/vs/editor/editor.worker.js
|
||||
$/browser-esm-parcel> ./node_modules/.bin/parcel build index.js
|
||||
$/browser-esm-parcel> ./node_modules/.bin/parcel build src/index.html
|
||||
</pre>
|
||||
|
||||
Then, <a href="./dist">open the ./dist folder</a>.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "helloworld",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"monaco-editor": "^0.11.0",
|
||||
"monaco-editor": "^0.12.0",
|
||||
"parcel-bundler": "^1.6.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
browser-esm-parcel/src/index.html
Normal file
12
browser-esm-parcel/src/index.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container" style="width:800px;height:600px;border:1px solid #ccc"></div>
|
||||
|
||||
<script src="index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -91,20 +91,20 @@ import 'monaco-editor/esm/vs/basic-languages/python/python.contribution.js';
|
|||
|
||||
|
||||
self.MonacoEnvironment = {
|
||||
getWorkerUrl: function (moduleId, label) {
|
||||
// if (label === 'json') {
|
||||
// return './json.worker.bundle.js';
|
||||
// }
|
||||
// if (label === 'css') {
|
||||
// return './css.worker.bundle.js';
|
||||
// }
|
||||
// if (label === 'html') {
|
||||
// return './html.worker.bundle.js';
|
||||
// }
|
||||
// if (label === 'typescript' || label === 'javascript') {
|
||||
// return './ts.worker.bundle.js';
|
||||
// }
|
||||
return './editor.worker.js';
|
||||
getWorker: function (moduleId, label) {
|
||||
if (label === 'json') {
|
||||
return new Worker('../node_modules/monaco-editor/esm/vs/language/json/json.worker')
|
||||
}
|
||||
if (label === 'css') {
|
||||
return new Worker('../node_modules/monaco-editor/esm/vs/language/css/css.worker')
|
||||
}
|
||||
if (label === 'html') {
|
||||
return new Worker('../node_modules/monaco-editor/esm/vs/language/html/html.worker')
|
||||
}
|
||||
if (label === 'typescript' || label === 'javascript') {
|
||||
return new Worker('../node_modules/monaco-editor/esm/vs/language/typescript/ts.worker')
|
||||
}
|
||||
return new Worker('../node_modules/monaco-editor/esm/vs/editor/editor.worker')
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue