Skip to content

Commit ddbda40

Browse files
committed
load monaco files from local server not from cdn
Signed-off-by: Jeeva Kandasamy <[email protected]>
1 parent 5535307 commit ddbda40

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"js-yaml": "^4.1.0",
2525
"lodash.clonedeep": "^4.5.0",
2626
"moment": "^2.29.4",
27+
"monaco-editor": "^0.36.1",
2728
"object-path": "^0.11.8",
2829
"qs": "^6.11.0",
2930
"rc-slider": "^9.7.5",

src/Components/CodeEditor/CodeEditorBasic.jsx

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as monaco from "monaco-editor"
12
import Editor, { loader } from "@monaco-editor/react"
23
import React from "react"
34

@@ -18,6 +19,11 @@ const consoleTheme = {
1819
},
1920
}
2021

22+
// load required files from local, not from CDN registry
23+
// see: https://github.com/suren-atoyan/monaco-react/blob/master/README.md#loader-config
24+
// https://github.com/suren-atoyan/monaco-react/issues/327
25+
loader.config({ monaco })
26+
2127
loader
2228
.init()
2329
.then((monaco) => {

yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -7287,6 +7287,11 @@ moment@^2.29.4:
72877287
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108"
72887288
integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==
72897289

7290+
monaco-editor@^0.36.1:
7291+
version "0.36.1"
7292+
resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.36.1.tgz#aad528c815605307473a1634612946921d8079b5"
7293+
integrity sha512-/CaclMHKQ3A6rnzBzOADfwdSJ25BFoFT0Emxsc4zYVyav5SkK9iA6lEtIeuN/oRYbwPgviJT+t3l+sjFa28jYg==
7294+
72907295
72917296
version "2.0.0"
72927297
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"

0 commit comments

Comments
 (0)