diff --git a/lib/index.js b/lib/index.js index 1750cb8..4d732b9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -69,9 +69,16 @@ module.exports = function(opt) { } cb = callCounter(files.length, cb); - pathsToCss.forEach(function(f) { - readFileAndPush(f, _this, cb); - }); + var f = 0; + var next = function() { + readFileAndPush(pathsToCss[f], _this, function() { + cb(); + if(pathsToCss.length > f) + next(); + }); + f++; + }; + next(); }); };