fix dist file is empty sometimes + minor config refactor

This commit is contained in:
Roman Hotsiy 2016-04-09 02:25:23 +03:00
parent 06e9dd3a0f
commit 6af848d0f4
2 changed files with 10 additions and 5 deletions

View File

@ -1,4 +1,6 @@
module.exports = {
var path = require('path');
var paths = {
source: 'lib/**/*.js',
html: 'lib/**/*.html',
scss: 'lib/**/*.scss',
@ -8,4 +10,8 @@ module.exports = {
tmp: '.tmp/',
demo: 'demo/**/*',
tests: '{lib,tests}/**/*.spec.js'
};
}
paths.redocBuilt = path.join(paths.output, paths.outputName);
module.exports = paths;

View File

@ -12,8 +12,6 @@ var sass = require('gulp-sass');
var replace = require('gulp-replace');
var rename = require('gulp-rename');
paths.redocBuilt = path.join(paths.output, paths.outputName);
gulp.task('build', function (callback) {
return runSequence(
'clean',
@ -96,7 +94,8 @@ function bundle(outputFile, minify, cb) {
{ format:'umd', sourceMaps: true, mangle: false, lowResSourceMaps: true, minify: minify }
)
.then(function() {
cb();
// wait some time to allow flush
setTimeout(() => cb(), 500);
})
.catch(function(err) {
cb(new Error(err));