1
0
Selaa lähdekoodia

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 11 vuotta sitten
vanhempi
commit
9b046a2842
2 muutettua tiedostoa jossa 7 lisäystä ja 3 poistoa
  1. 2 3
      index.html
  2. 5 0
      requirejs.amd.json

+ 2 - 3
index.html

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

+ 5 - 0
requirejs.amd.json

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