diff --git a/lib/ace/loader_build.js b/lib/ace/loader_build.js index a9497dacd80..9b9fd068560 100644 --- a/lib/ace/loader_build.js +++ b/lib/ace/loader_build.js @@ -43,6 +43,10 @@ function init(packaged) { var currentScript = (document.currentScript || document._currentScript ); // native or polyfill var currentDocument = currentScript && currentScript.ownerDocument || document; + if (currentScript && currentScript.src) { + scriptUrl = currentScript.src.split(/[?#]/)[0].split("/").slice(0, -1).join("/") || ""; + } + var scripts = currentDocument.getElementsByTagName("script"); for (var i=0; i