Skip to content

Commit 53f44cb

Browse files
committed
chore: upgrade monaco-editor version
1 parent 6e59449 commit 53f44cb

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"xml": "^1.0.1",
4242
"@ant-design/compatible": "^1.1.0",
4343
"@ant-design/pro-layout": "7.19.11",
44-
"@monaco-editor/react": "^4.4.4",
44+
"@monaco-editor/react": "^4.6.0",
4545
"array-move": "^3.0.1",
4646
"deep-equal": "^2.0.5",
4747
"echarts": "^4.6.0",

client/src/components/Editor/MonacoEditor.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Editor from '@monaco-editor/react';
1+
import Editor, { loader } from '@monaco-editor/react';
22
import { message, Spin } from 'antd';
33
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
44

@@ -26,6 +26,14 @@ const MonacoEditorOptions = {
2626
},
2727
} as any;
2828

29+
30+
// solve jsdelivr cdn load error
31+
loader.config({
32+
paths: {
33+
vs: "https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.31.1/min/vs"
34+
}
35+
});
36+
2937
const _MonacoEditor = (props, ref) => {
3038
const { defaultValue, onMount, onChange, onSave } = props;
3139
const container = useRef(null);

pnpm-lock.yaml

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)