Permalink
Browse files

Define lumbar-loader-server loader

  • Loading branch information...
1 parent d323958 commit d6e197f188afb15dd9b712b012088b5e036f027e @kpdecker kpdecker committed Oct 20, 2013
Showing with 21 additions and 3 deletions.
  1. +16 −0 lumbar-loader-server.js
  2. +5 −3 lumbar.json
View
@@ -0,0 +1,16 @@
+/*jshint evil: true */
+/*global loadResources, lumbarLoader */
+lumbarLoader.loadJS = function(moduleName, callback, options) {
+ return loadResources(moduleName, 'js', callback, function(href, callback) {
+ nextTick(function() {
+ window.loadInContext(href.replace(/\.js$/, '-server.js'), callback);
+ });
+ }).length;
+};
+lumbarLoader.loadCSS = function(moduleName, callback, options) {
+ loadResources(moduleName, 'css', callback, function(href) {
+ $('head').append('<link rel="stylesheet" href="' + href + '">');
+ });
+
+ return 0;
+};
View
@@ -7,12 +7,13 @@
// Loads module resources through standard link and script tags.
"lumbar-loader": {
"scripts": [
- {"src": "lib/script.js", "global": true, "combined": false},
+ {"src": "lib/script.js", "global": true, "combined": false, "server": false},
{"src": "lib/queue.js", "global": true},
{"src": "local-cache.js", "global": true},
{"src": "lumbar-loader.js"},
{"src": "lumbar-loader-events.js"},
- {"src": "lumbar-loader-standard.js"},
+ {"src": "lumbar-loader-standard.js", "server": false},
+ {"src": "lumbar-loader-server.js", "server": true},
{"module-map": true}
]
},
@@ -27,7 +28,8 @@
{"src": "local-cache.js", "global": true},
{"src": "lumbar-loader.js"},
{"src": "lumbar-loader-events.js"},
- {"src": "lumbar-loader-localstorage.js"},
+ {"src": "lumbar-loader-localstorage.js", "server": false},
+ {"src": "lumbar-loader-server.js", "server": true},
{"module-map": true}
]
}

0 comments on commit d6e197f

Please sign in to comment.