diff --git a/gulpfile.js b/gulpfile.js index 72f555e40..81e090913 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -125,12 +125,17 @@ gulp.task('unused-files', (cb) => { /** * Clean `dist` folder before build */ -gulp.task('clean', () => { +gulp.task('clean-dirs', () => { return gulp .src(`{${distDir}/*,${demoDir}/*}`, { read: false }) .pipe(clean()); }); +gulp.task('clean-jekyll', (cb) => { + return cp.spawn('bundle', ['exec', 'jekyll', 'clean'], { stdio: 'inherit' }) + .on('close', cb); +}); + /** * Compile SASS to CSS and move it to dist directory */ @@ -219,7 +224,7 @@ gulp.task('js', () => { */ gulp.task('watch-jekyll', (cb) => { browserSync.notify('Building Jekyll'); - return cp.spawn('bundle', ['exec', 'jekyll', 'build', '--watch', '--destination', demoDir], { stdio: 'inherit' }) + return cp.spawn('bundle', ['exec', 'jekyll', 'build', '--watch', '--destination', demoDir, '--trace'], { stdio: 'inherit' }) .on('close', cb); }); @@ -230,7 +235,7 @@ gulp.task('build-jekyll', (cb) => { var env = Object.create(process.env); env.JEKYLL_ENV = 'production'; - return cp.spawn('bundle', ['exec', 'jekyll', 'build', '--destination', demoDir], { env: env, stdio: 'inherit' }) + return cp.spawn('bundle', ['exec', 'jekyll', 'build', '--destination', demoDir, '--trace'], { env: env, stdio: 'inherit' }) .on('close', cb); }); @@ -333,6 +338,8 @@ gulp.task('add-banner', () => { .pipe(gulp.dest(`${distDir}`)) }); +gulp.task('clean', gulp.series('clean-dirs', 'clean-jekyll')); + gulp.task('start', gulp.series('clean', 'sass', 'js', 'build-jekyll', gulp.parallel('watch-jekyll', 'watch', 'browser-sync'))); gulp.task('build-core', gulp.series('build-on', 'clean', 'sass', 'js', 'copy-images', 'copy-libs', 'add-banner'));