فهرست منبع

use monaco microsoft cdn

AykutSarac 2 سال پیش
والد
کامیت
87fba5e410
3فایلهای تغییر یافته به همراه14 افزوده شده و 4 حذف شده
  1. 1 0
      package.json
  2. 8 4
      src/containers/Editor/JsonEditor/index.tsx
  3. 5 0
      yarn.lock

+ 1 - 0
package.json

@@ -17,6 +17,7 @@
     "allotment": "^1.14.5",
     "compress-json": "^2.0.1",
     "html-to-image": "^1.9.0",
+    "monaco-editor": "^0.33.0",
     "next": "^12.1.5",
     "next-transpile-modules": "^9.0.0",
     "parse-json": "^6.0.2",

+ 8 - 4
src/containers/Editor/JsonEditor/index.tsx

@@ -1,13 +1,17 @@
 import React from "react";
+import styled from "styled-components";
 import Editor from "@monaco-editor/react";
 import parseJson from "parse-json";
-import styled from "styled-components";
-import { ErrorContainer } from "src/components/ErrorContainer/ErrorContainer";
-import { Loading } from "src/components/Loading";
 import { loader } from "@monaco-editor/react";
+import { ErrorContainer } from "src/components/ErrorContainer/ErrorContainer";
 import useConfig from "src/hooks/store/useConfig";
+import { Loading } from "src/components/Loading";
 
-loader.config({ paths: { vs: "/monaco-editor/min/vs" } });
+loader.config({
+  paths: {
+    vs: "https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/min/vs",
+  },
+});
 
 const StyledEditorWrapper = styled.div`
   display: flex;

+ 5 - 0
yarn.lock

@@ -5070,6 +5070,11 @@ mkdirp@^0.5.5:
   dependencies:
     minimist "^1.2.6"
 
+monaco-editor@^0.33.0:
+  version "0.33.0"
+  resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.33.0.tgz#842e244f3750a2482f8a29c676b5684e75ff34af"
+  integrity sha512-VcRWPSLIUEgQJQIE0pVT8FcGBIgFoxz7jtqctE+IiCxWugD0DwgyQBcZBhdSrdMC84eumoqMZsGl2GTreOzwqw==
+
 moo@^0.5.0:
   version "0.5.1"
   resolved "https://registry.yarnpkg.com/moo/-/moo-0.5.1.tgz#7aae7f384b9b09f620b6abf6f74ebbcd1b65dbc4"