Skip to content

Commit

Permalink
Update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Jan 28, 2021
1 parent 75bef74 commit c645060
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
12 changes: 0 additions & 12 deletions explorer/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>jsonc-eslint-parser</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.21.3/min/vs/loader.min.js"></script>
<script>
window.require.config({
paths: {
vs: "https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.21.2/min/vs"
},
'vs/nls': {
availableLanguages: {
'*': 'ja'
}
}
})
</script>
</head>
<body>
<noscript>
Expand Down
13 changes: 13 additions & 0 deletions explorer/src/components/MonacoEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
</template>

<script>
const monacoScript = Array.from(window.document.head.querySelectorAll("script")).find(
(script) => script.src && script.src.includes("monaco"),
)
window.require.config({
paths: {
vs: monacoScript.src.replace(/\/vs\/.*$/u, "/vs"),
},
"vs/nls": {
availableLanguages: {
"*": "ja",
},
},
})
const editorLoaded = new Promise((resolve) => {
window.require(["vs/editor/editor.main"], (r) => {
resolve(r)
Expand Down

0 comments on commit c645060

Please sign in to comment.