diff --git a/build/build.js b/build/build.js index 1731220..ca928aa 100755 --- a/build/build.js +++ b/build/build.js @@ -16,34 +16,34 @@ if (!process.env.NODE_ENV) { | SASS Tasks |-------------------------------------------------------------------------- */ -gulp.task('sass:clean', require('./tasks/sass/clean')) -gulp.task('sass:lint', require('./tasks/sass/lint')) -gulp.task('sass:build', require('./tasks/sass/build')) +gulp.task('sass:clean', (cb) => { require('./tasks/sass/clean') (cb())}) +gulp.task('sass:lint', (cb) => { require('./tasks/sass/lint') (cb())}) +gulp.task('sass:build', (cb) => { require('./tasks/sass/build') (cb())}) /* |-------------------------------------------------------------------------- | Fonts Tasks |-------------------------------------------------------------------------- */ -gulp.task('font:clean', require('./tasks/font/clean')) -gulp.task('font:build', require('./tasks/font/build')) +gulp.task('font:clean', (cb) => { require('./tasks/font/clean') (cb())}) +gulp.task('font:build', (cb) => { require('./tasks/font/build') (cb())}) /* |-------------------------------------------------------------------------- | Images Tasks |-------------------------------------------------------------------------- */ -gulp.task('image:clean', require('./tasks/image/clean')) -gulp.task('image:build', require('./tasks/image/build')) +gulp.task('image:clean', (cb) => { require('./tasks/image/clean') (cb())}) +gulp.task('image:build', (cb) => { require('./tasks/image/build') (cb())}) /* |-------------------------------------------------------------------------- | JavaScript Tasks |-------------------------------------------------------------------------- */ -gulp.task('javascript:clean', require('./tasks/javascript/clean')) -gulp.task('javascript:lint', require('./tasks/javascript/lint')) -gulp.task('javascript:build', ['javascript:clean'], require('./tasks/javascript/build')) +gulp.task('javascript:clean', (cb) => { require('./tasks/javascript/clean') (cb())}) +gulp.task('javascript:lint', (cb) => { require('./tasks/javascript/lint') (cb())}) +gulp.task('javascript:build', gulp.series(['javascript:clean']), (cb) => { require('./tasks/javascript/build') (cb())}) /* |-------------------------------------------------------------------------- @@ -54,10 +54,10 @@ gulp.task('javascript:build', ['javascript:clean'], require('./tasks/javascript/ | They compose a complete building pipline for each domain. | */ -gulp.task('font', ['font:clean', 'font:build']) -gulp.task('image', ['image:clean', 'image:build']) -gulp.task('sass', ['sass:clean', 'sass:lint', 'sass:build']) -gulp.task('javascript', ['javascript:clean', 'javascript:lint', 'javascript:build']) +gulp.task('font', gulp.series(['font:clean', 'font:build'])) +gulp.task('image', gulp.series(['image:clean', 'image:build'])) +gulp.task('sass', gulp.series(['sass:clean', 'sass:lint', 'sass:build'])) +gulp.task('javascript', gulp.series(['javascript:clean', 'javascript:lint', 'javascript:build'])) /* |-------------------------------------------------------------------------- @@ -72,7 +72,11 @@ gulp.task('javascript', ['javascript:clean', 'javascript:lint', 'javascript:buil gulp.task('sync', () => { browsersync.init({ open: false, - server: { baseDir: '../public' } + server: { baseDir: '../public' }, + /* Uncomment for Custom/Docker Ports + proxy : "localhost:8080", + port: "4000" + */ }) }) @@ -86,20 +90,27 @@ gulp.task('sync', () => { | and recompiling separetly for better performance. | */ -gulp.task('watch', ['sync'], () => { - gulp.watch('../resources/assets/sass/**/*.scss', ['sass', reload]) +gulp.task('watch_tasks', () => { + + gulp.watch('../src/**/*.scss', gulp.series(['sass'])) .on('error', message.error('WATCH: Sass')) + .on("change", gulp.series(reload)) - gulp.watch('../resources/assets/js/**/*.js', ['javascript', reload]) + gulp.watch('../src/assets/js/**/*.js', gulp.series(['javascript'])) .on('error', message.error('WATCH: Javascript')) + .on("change", gulp.series(reload)) - gulp.watch('../resources/assets/fonts/**/*.{eot,woff,woff2,ttf,svg}', ['font', reload]) + gulp.watch('../src/assets/fonts/**/*.{eot,woff,woff2,ttf,svg}', gulp.series(['font'])) .on('error', message.error('WATCH: Fonts')) + .on("change", gulp.series(reload)) - gulp.watch('../resources/assets/images/**/*.{jpg,jpeg,png,gif,svg}', ['image', reload]) + gulp.watch('../src/assets/images/**/*.{jpg,jpeg,png,gif,svg}', gulp.series(['image'])) .on('error', message.error('WATCH: Images')) + .on("change", gulp.series(reload)) }) +gulp.task('watch', gulp.parallel(['sync', 'watch_tasks'])) + /* |-------------------------------------------------------------------------- | Default Task @@ -110,4 +121,4 @@ gulp.task('watch', ['sync'], () => { | tasks and completely building the whole project. | */ -gulp.task('default', ['sass', 'javascript', 'font', 'image']) +gulp.task('default', gulp.series(['sass', 'javascript', 'font', 'image']))