From 5c890d5843557cfe75a9c12e05ac5445fd2c4bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=98=84=EC=84=B1=ED=95=84?= Date: Mon, 29 Jan 2024 11:10:50 +0900 Subject: [PATCH] =?UTF-8?q?monaco=20worker=20context=20path=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ApiTestManager/src/index.js | 13 ++++++++----- .../static/plugins/apitestmanager/app.bundle.js | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ApiTestManager/src/index.js b/ApiTestManager/src/index.js index 03a95f4..d4c4ed6 100644 --- a/ApiTestManager/src/index.js +++ b/ApiTestManager/src/index.js @@ -7,20 +7,23 @@ window.MonacoEnvironment = { if (!contextPath) { contextPath = '/'; } + if (!contextPath.endsWith('/')) { + contextPath += '/'; + } if (label === 'json') { - return contextPath + '/plugins/apitestmanager/json.worker.bundle.js'; + return contextPath + 'plugins/apitestmanager/json.worker.bundle.js'; } if (label === 'css' || label === 'scss' || label === 'less') { - return contextPath + '/plugins/apitestmanager/css.worker.bundle.js'; + return contextPath + 'plugins/apitestmanager/css.worker.bundle.js'; } if (label === 'html' || label === 'handlebars' || label === 'razor') { - return contextPath + '/plugins/apitestmanager/html.worker.bundle.js'; + return contextPath + 'plugins/apitestmanager/html.worker.bundle.js'; } if (label === 'typescript' || label === 'javascript') { - return contextPath + '/plugins/apitestmanager/ts.worker.bundle.js'; + return contextPath + 'plugins/apitestmanager/ts.worker.bundle.js'; } - return '/plugins/apitestmanager/editor.worker.bundle.js'; + return contextPath + 'plugins/apitestmanager/editor.worker.bundle.js'; } }; diff --git a/src/main/resources/static/plugins/apitestmanager/app.bundle.js b/src/main/resources/static/plugins/apitestmanager/app.bundle.js index 2a64111..46b5048 100644 --- a/src/main/resources/static/plugins/apitestmanager/app.bundle.js +++ b/src/main/resources/static/plugins/apitestmanager/app.bundle.js @@ -587,7 +587,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ APITestManager)\n/* harmony export */ });\n/* harmony import */ var _APITester__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./APITester */ \"./src/APITester.js\");\n/* harmony import */ var _APIScenario__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./APIScenario */ \"./src/APIScenario.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\nwindow.MonacoEnvironment = {\n getWorkerUrl: function getWorkerUrl(moduleId, label) {\n var contextPath = document.querySelector('meta[name=\"context-path\"]').getAttribute('content');\n if (!contextPath) {\n contextPath = '/';\n }\n if (label === 'json') {\n return contextPath + '/plugins/apitestmanager/json.worker.bundle.js';\n }\n if (label === 'css' || label === 'scss' || label === 'less') {\n return contextPath + '/plugins/apitestmanager/css.worker.bundle.js';\n }\n if (label === 'html' || label === 'handlebars' || label === 'razor') {\n return contextPath + '/plugins/apitestmanager/html.worker.bundle.js';\n }\n if (label === 'typescript' || label === 'javascript') {\n return contextPath + '/plugins/apitestmanager/ts.worker.bundle.js';\n }\n return '/plugins/apitestmanager/editor.worker.bundle.js';\n }\n};\nvar APITestManager = /*#__PURE__*/_createClass(function APITestManager(servers) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, APITestManager);\n this.apiTester = new _APITester__WEBPACK_IMPORTED_MODULE_0__[\"default\"](options.contextPath);\n this.apiTester.init(servers);\n this.apiScenario = new _APIScenario__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.apiTester, options.contextPath);\n this.apiScenario.init();\n});\n\n\n//# sourceURL=webpack://APITestManager/./src/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ APITestManager)\n/* harmony export */ });\n/* harmony import */ var _APITester__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./APITester */ \"./src/APITester.js\");\n/* harmony import */ var _APIScenario__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./APIScenario */ \"./src/APIScenario.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\nwindow.MonacoEnvironment = {\n getWorkerUrl: function getWorkerUrl(moduleId, label) {\n var contextPath = document.querySelector('meta[name=\"context-path\"]').getAttribute('content');\n if (!contextPath) {\n contextPath = '/';\n }\n if (!contextPath.endsWith('/')) {\n contextPath += '/';\n }\n if (label === 'json') {\n return contextPath + 'plugins/apitestmanager/json.worker.bundle.js';\n }\n if (label === 'css' || label === 'scss' || label === 'less') {\n return contextPath + 'plugins/apitestmanager/css.worker.bundle.js';\n }\n if (label === 'html' || label === 'handlebars' || label === 'razor') {\n return contextPath + 'plugins/apitestmanager/html.worker.bundle.js';\n }\n if (label === 'typescript' || label === 'javascript') {\n return contextPath + 'plugins/apitestmanager/ts.worker.bundle.js';\n }\n return contextPath + 'plugins/apitestmanager/editor.worker.bundle.js';\n }\n};\nvar APITestManager = /*#__PURE__*/_createClass(function APITestManager(servers) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, APITestManager);\n this.apiTester = new _APITester__WEBPACK_IMPORTED_MODULE_0__[\"default\"](options.contextPath);\n this.apiTester.init(servers);\n this.apiScenario = new _APIScenario__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.apiTester, options.contextPath);\n this.apiScenario.init();\n});\n\n\n//# sourceURL=webpack://APITestManager/./src/index.js?"); /***/ }),