|
|
@ -134,10 +134,15 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
module.exports.load = function (url /*:string*/, cb /*:()=>void*/) {
|
|
|
|
module.exports.load = function (url /*:string*/, cb /*:()=>void*/) {
|
|
|
|
|
|
|
|
var btime = +new Date();
|
|
|
|
|
|
|
|
var done = function () {
|
|
|
|
|
|
|
|
console.log("Compiling [" + url + "] took " + (+new Date() - btime) + "ms");
|
|
|
|
|
|
|
|
cb();
|
|
|
|
|
|
|
|
};
|
|
|
|
cacheGet(url, function (css) {
|
|
|
|
cacheGet(url, function (css) {
|
|
|
|
if (css) {
|
|
|
|
if (css) {
|
|
|
|
inject(css, url);
|
|
|
|
inject(css, url);
|
|
|
|
return void cb();
|
|
|
|
return void done();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log('CACHE MISS ' + url);
|
|
|
|
console.log('CACHE MISS ' + url);
|
|
|
|
((/\.less([\?\#].*)?$/.test(url)) ? loadLess : loadCSS)(url, function (err, css) {
|
|
|
|
((/\.less([\?\#].*)?$/.test(url)) ? loadLess : loadCSS)(url, function (err, css) {
|
|
|
@ -145,7 +150,7 @@ define([
|
|
|
|
var output = fixAllURLs(css, url);
|
|
|
|
var output = fixAllURLs(css, url);
|
|
|
|
cachePut(url, output);
|
|
|
|
cachePut(url, output);
|
|
|
|
inject(output, url);
|
|
|
|
inject(output, url);
|
|
|
|
cb();
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|