promisify build steps

This commit is contained in:
Kushan Joshi
2017-09-28 17:10:30 +05:30
parent 07ac2a372f
commit 6eb509d413
4 changed files with 131 additions and 66 deletions
+10 -5
View File
@@ -11,8 +11,11 @@ var buildData = require('./build_data')(isDevelopment);
var buildSrc = require('./build_src')(isDevelopment);
var buildCSS = require('./build_css')(isDevelopment);
buildData();
buildSrc();
buildData()
.then(function () {
return buildSrc();
});
buildCSS();
if (isDevelopment) {
@@ -35,9 +38,11 @@ if (isDevelopment) {
],
function(err, watcher) {
watcher.on('all', function() {
buildData();
// need to recompute js files when data changes
buildSrc();
buildData()
.then(function () {
// need to recompute js files when data changes
buildSrc();
});
});
}
);