Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Gulp Fix #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 32 additions & 21 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could simplify it to:
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())})

/*
|--------------------------------------------------------------------------
Expand All @@ -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']))

/*
|--------------------------------------------------------------------------
Expand All @@ -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"
*/
})
})

Expand All @@ -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))
Copy link

@eaitbrahim eaitbrahim Oct 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please be consistent with the use of quotes, if you're using a single quote then just keep using it...


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
Expand All @@ -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']))