From 6af848d0f4e6e8a6799f3dca9309a0cae8a6decd Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sat, 9 Apr 2016 02:25:23 +0300 Subject: [PATCH] fix dist file is empty sometimes + minor config refactor --- build/paths.js | 10 ++++++++-- build/tasks/build.js | 5 ++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/build/paths.js b/build/paths.js index 06f5c267..e2f27ffe 100644 --- a/build/paths.js +++ b/build/paths.js @@ -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; diff --git a/build/tasks/build.js b/build/tasks/build.js index 46fc4dfa..ef14693b 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -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));