monaco worker context path 처리 수정

This commit is contained in:
현성필
2024-01-29 11:10:50 +09:00
parent b490e37c35
commit 5c890d5843
2 changed files with 9 additions and 6 deletions
+8 -5
View File
@@ -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';
}
};
@@ -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?");
/***/ }),