Przeglądaj źródła

helios getting right requirejs path

... from devDependencies of itself or enclosing amber,
every time from config.js with help or requirejs.amd.json.
Herbert Vojčík 10 lat temu
rodzic
commit
9b046a2842
2 zmienionych plików z 7 dodań i 3 usunięć
  1. 2 3
      index.html
  2. 5 0
      requirejs.amd.json

+ 2 - 3
index.html

@@ -11,7 +11,7 @@
 
     <div id="includes">
       <script type='text/javascript'>
-        var base = decodeURIComponent(window.location.search.slice(1));
+        var base = decodeURIComponent(window.location.search.slice(1)).replace(/\/$/, "");
         var script = document.createElement("script");
         script.src = base + "/config.js";
         document.getElementsByTagName("head")[0].appendChild(script);
@@ -19,7 +19,6 @@
           if (typeof require !== "undefined") {
             clearInterval(__interval);
             require.baseUrl = base;
-            var amberPath = base + "/" + require.paths.amber;
             require.callback = function () {
               require(["helios/set"], function (smalltalk) {
                 window.onbeforeunload = function() {
@@ -31,7 +30,7 @@
               });
             };
             script = document.createElement("script");
-            script.src = "node_modules/requirejs/require.js";
+            script.src = base + "/" + require.paths.requireJS + ".js";
             document.getElementsByTagName("head")[0].appendChild(script);
           }
         }, 200);

+ 5 - 0
requirejs.amd.json

@@ -0,0 +1,5 @@
+{
+    "paths": {
+        "requireJS": "require"
+    }
+}