Browse Source

Commenting bower detection and reaction

Herbert Vojčík 10 years ago
parent
commit
52c290a235
1 changed files with 7 additions and 0 deletions
  1. 7 0
      support/amber.js

+ 7 - 0
support/amber.js

@@ -24,6 +24,13 @@ require = function (require) {
     // e.g. http://app.com/index.html -> http://app.com/
     var document_home = window.location.href.replace(/\/[^\/]+$/, "");
 
+    // at the present moment, bower tries to have flat hierarchy,
+    // which leads to two possible scenarios:
+    // 1. amber itself was deployed via bower,
+    //    its libraries are next to it; document_home from above covers this
+    // 2. amber was deployed in different fashion,
+    //    its libraries are included by bower locally; document_home is fixed above
+    // The detection is done by looking for '/bower_components/' in amber path.
     if (!amber_home.match(/\/bower_components\//)) {
         document_home = amber_home;
     }