Closed revazi closed 7 years ago
Why did you choose Q instead of Native promises implementation (may be with a polyfill) or something with similar API (like Bluebird)?
I'm not doing anything special with Q.
We can change the Q to native promises, implement deferred object and replace Q
with Promise
Promise.defer = function() {
var result = {};
result.promise = new Promise(function(resolve, reject) {
result.resolve = resolve;
result.reject = reject;
});
return result;
};
or we can just push new promises in the array directly, like so
promises.push(new Promise(function(resolve, reject){
var pipeline = gulp.src(config.chatStylesPath + '/' + dir + '/js/source/**/*.js')
.pipe(concat('scripts.js'))
.pipe(uglify({preserveComments: 'some'}))
.pipe(gulp.dest(config.chatStylesPath + '/' + dir + '/js/compiled'));
pipeline.on('end', resolve);
pipeline.on('error', reject);
}));
Thanks @revazi, your code has been merged in #195.
Compiles all styles not only default. Added 'watch' task for development.