|
|
@ -1,24 +1,4 @@
|
|
|
|
(function () {
|
|
|
|
(function () {
|
|
|
|
let IS_FILE_PROTOCOL = window.location.protocol === 'file:';
|
|
|
|
|
|
|
|
let DIRNAME = null;
|
|
|
|
|
|
|
|
if (IS_FILE_PROTOCOL) {
|
|
|
|
|
|
|
|
let port = window.location.port;
|
|
|
|
|
|
|
|
if (port.length > 0) {
|
|
|
|
|
|
|
|
port = ':' + port;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
DIRNAME =
|
|
|
|
|
|
|
|
window.location.protocol +
|
|
|
|
|
|
|
|
'//' +
|
|
|
|
|
|
|
|
window.location.hostname +
|
|
|
|
|
|
|
|
port +
|
|
|
|
|
|
|
|
window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let bases = document.getElementsByTagName('base');
|
|
|
|
|
|
|
|
if (bases.length > 0) {
|
|
|
|
|
|
|
|
DIRNAME = DIRNAME + '/' + bases[0].getAttribute('href');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let LOADER_OPTS = (function () {
|
|
|
|
let LOADER_OPTS = (function () {
|
|
|
|
function parseQueryString() {
|
|
|
|
function parseQueryString() {
|
|
|
|
let str = window.location.search;
|
|
|
|
let str = window.location.search;
|
|
|
@ -70,27 +50,15 @@
|
|
|
|
let resolvedPath = this.paths[this.selectedPath];
|
|
|
|
let resolvedPath = this.paths[this.selectedPath];
|
|
|
|
if (/\.\//.test(resolvedPath)) {
|
|
|
|
if (/\.\//.test(resolvedPath)) {
|
|
|
|
// starts with ./ => treat as relative to the root path
|
|
|
|
// starts with ./ => treat as relative to the root path
|
|
|
|
if (IS_FILE_PROTOCOL) {
|
|
|
|
resolvedPath = PATH_PREFIX + '/monaco-editor/' + this.rootPath + '/' + resolvedPath;
|
|
|
|
resolvedPath = DIRNAME + '/../../' + this.rootPath + '/' + resolvedPath;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
resolvedPath = PATH_PREFIX + '/monaco-editor/' + this.rootPath + '/' + resolvedPath;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (
|
|
|
|
} else if (
|
|
|
|
this.selectedPath === 'npm/dev' ||
|
|
|
|
this.selectedPath === 'npm/dev' ||
|
|
|
|
this.selectedPath === 'npm/min' ||
|
|
|
|
this.selectedPath === 'npm/min' ||
|
|
|
|
this.isRelease()
|
|
|
|
this.isRelease()
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
if (IS_FILE_PROTOCOL) {
|
|
|
|
resolvedPath = PATH_PREFIX + '/monaco-editor/' + resolvedPath;
|
|
|
|
resolvedPath = DIRNAME + '/../../' + resolvedPath;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
resolvedPath = PATH_PREFIX + '/monaco-editor/' + resolvedPath;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (IS_FILE_PROTOCOL) {
|
|
|
|
resolvedPath = PATH_PREFIX + resolvedPath;
|
|
|
|
resolvedPath = DIRNAME + '/../../../' + resolvedPath;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
resolvedPath = PATH_PREFIX + resolvedPath;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return resolvedPath;
|
|
|
|
return resolvedPath;
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -208,13 +176,8 @@
|
|
|
|
loadScript(RESOLVED_CORE.getResolvedPath(PATH_PREFIX) + '/loader.js', function () {
|
|
|
|
loadScript(RESOLVED_CORE.getResolvedPath(PATH_PREFIX) + '/loader.js', function () {
|
|
|
|
let loaderPathsConfig = {};
|
|
|
|
let loaderPathsConfig = {};
|
|
|
|
window.AMD = true;
|
|
|
|
window.AMD = true;
|
|
|
|
if (IS_FILE_PROTOCOL) {
|
|
|
|
loaderPathsConfig['vs/fillers/monaco-editor-core'] =
|
|
|
|
loaderPathsConfig['vs/fillers/monaco-editor-core'] =
|
|
|
|
PATH_PREFIX + '/monaco-editor/./out/amd/fillers/monaco-editor-core-amd';
|
|
|
|
DIRNAME + '/../.././out/amd/fillers/monaco-editor-core-amd';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
loaderPathsConfig['vs/fillers/monaco-editor-core'] =
|
|
|
|
|
|
|
|
PATH_PREFIX + '/monaco-editor/./out/amd/fillers/monaco-editor-core-amd';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!RESOLVED_CORE.isRelease()) {
|
|
|
|
if (!RESOLVED_CORE.isRelease()) {
|
|
|
|
RESOLVED_PLUGINS.forEach(function (plugin) {
|
|
|
|
RESOLVED_PLUGINS.forEach(function (plugin) {
|
|
|
|
plugin.generateLoaderConfig(loaderPathsConfig, PATH_PREFIX);
|
|
|
|
plugin.generateLoaderConfig(loaderPathsConfig, PATH_PREFIX);
|
|
|
|