From 787757ae75a08063376069aa8648383b735b5a64 Mon Sep 17 00:00:00 2001 From: Erick Silva Date: Mon, 15 Feb 2021 15:38:23 -0300 Subject: [PATCH 1/3] Gulp Fix --- build/build.js | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/build/build.js b/build/build.js index 1731220..43df1a3 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')) +ulp.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'])) /* |-------------------------------------------------------------------------- @@ -86,7 +86,7 @@ gulp.task('sync', () => { | and recompiling separetly for better performance. | */ -gulp.task('watch', ['sync'], () => { +gulp.task('watch', ['sync'], (cb) => { gulp.watch('../resources/assets/sass/**/*.scss', ['sass', reload]) .on('error', message.error('WATCH: Sass')) @@ -98,6 +98,8 @@ gulp.task('watch', ['sync'], () => { gulp.watch('../resources/assets/images/**/*.{jpg,jpeg,png,gif,svg}', ['image', reload]) .on('error', message.error('WATCH: Images')) + + cb() }) /* @@ -110,4 +112,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'])) From 69bdf79f5a44db31b372c9910fb664e71a01a6e6 Mon Sep 17 00:00:00 2001 From: Erick Silva Date: Tue, 16 Feb 2021 08:34:15 -0300 Subject: [PATCH 2/3] gulp fix --- build/build.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.js b/build/build.js index 43df1a3..09329c8 100755 --- a/build/build.js +++ b/build/build.js @@ -25,7 +25,7 @@ gulp.task('sass:build', (cb) => {require('./tasks/sass/build') ( cb() )} ) | Fonts Tasks |-------------------------------------------------------------------------- */ -ulp.task('font:clean', (cb) => {require('./tasks/font/clean') ( cb() )} ) +gulp.task('font:clean', (cb) => {require('./tasks/font/clean') ( cb() )} ) gulp.task('font:build', (cb) => {require('./tasks/font/build') ( cb() )} ) /* @@ -86,7 +86,7 @@ gulp.task('sync', () => { | and recompiling separetly for better performance. | */ -gulp.task('watch', ['sync'], (cb) => { +gulp.task('watch', gulp.series(['sync']), (cb) => { gulp.watch('../resources/assets/sass/**/*.scss', ['sass', reload]) .on('error', message.error('WATCH: Sass')) From 2ea8145489543e51587d64f3cba88cf8d14354cf Mon Sep 17 00:00:00 2001 From: Erick Silva Date: Wed, 17 Feb 2021 09:51:37 -0300 Subject: [PATCH 3/3] Browser Reload Adjustments --- build/build.js | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/build/build.js b/build/build.js index 09329c8..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', (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() )} ) +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', (cb) => {require('./tasks/font/clean') ( cb() )} ) -gulp.task('font:build', (cb) => {require('./tasks/font/build') ( cb() )} ) +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', (cb) => { require('./tasks/image/clean') ( cb() )} ) -gulp.task('image:build', (cb) => { require('./tasks/image/build') ( cb() )} ) +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', (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())}); +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())}) /* |-------------------------------------------------------------------------- @@ -72,7 +72,11 @@ gulp.task('javascript', gulp.series(['javascript:clean', 'javascript:lint', 'jav gulp.task('sync', () => { browsersync.init({ open: false, - server: { baseDir: '../public' } + server: { baseDir: '../public' }, + /* Uncomment for Custom/Docker Ports + proxy : "localhost:8080", + port: "4000" + */ }) }) @@ -86,22 +90,27 @@ gulp.task('sync', () => { | and recompiling separetly for better performance. | */ -gulp.task('watch', gulp.series(['sync']), (cb) => { - 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')) - - cb() + .on("change", gulp.series(reload)) }) +gulp.task('watch', gulp.parallel(['sync', 'watch_tasks'])) + /* |-------------------------------------------------------------------------- | Default Task