Skip to content

Commit

Permalink
Fixed image minification watch task
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhawk1ns committed Oct 31, 2017
1 parent b925bff commit 3d7fe29
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
21 changes: 12 additions & 9 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ gulp.task('frontend:vendor:js', function() {
* Multifaceted tasks
*/

gulp.task('build', ['images', 'frontend:sass', 'frontend:js']);
gulp.task('build', ['frontend:sass', 'frontend:js']);
gulp.task('build:admin', ['admin:sass', 'admin:js']);

gulp.task('prep', ['images', 'frontend:vendor:sass', 'frontend:vendor:js']);
gulp.task('prep:admin', ['images', 'admin:vendor:sass', 'admin:vendor:js']);
gulp.task('prep', ['frontend:vendor:sass', 'frontend:vendor:js']);
gulp.task('prep:admin', ['admin:vendor:sass', 'admin:vendor:js']);
gulp.task('prep:all', ['frontend:vendor:sass', 'frontend:vendor:js', 'images', 'admin:vendor:sass', 'admin:vendor:js']);

gulp.task('prep:sync', ['prep', 'frontend:sync:init']);
Expand All @@ -212,20 +212,23 @@ gulp.task('sync', ['frontend:sync:sass', 'frontend:sync:js']);
gulp.task('default', ['prep', 'build']);

/**
* Watch tasks (use "-" for sequential task compatibility)
* Watch tasks
*/

gulp.task('watch', ['build'], () => {
gulp.watch([config.assets.frontend.styles], ['frontend:sass']);
gulp.watch([config.assets.frontend.scripts], ['frontend:js']);
gulp.task('watch', ['images', 'build'], () => {
gulp.watch("assets/images/**/*", {cwd:'./'}, ['images']);
gulp.watch(config.assets.frontend.styles, ['frontend:sass']);
gulp.watch(config.assets.frontend.scripts, ['frontend:js']);
});

gulp.task('watch:sync', ['sync'], () => {
gulp.task('watch:sync', ['images', 'sync'], () => {
gulp.watch("assets/images/**/*", {cwd:'./'}, ['images']);
gulp.watch([config.assets.frontend.styles], ['frontend:sync:sass']);
gulp.watch([config.assets.frontend.scripts], ['frontend:sync:js']);
});

gulp.task('watch:all', ['build', 'build:admin'], () => {
gulp.task('watch:all', ['images', 'build', 'build:admin'], () => {
gulp.watch("assets/images/**/*", {cwd:'./'}, ['images']);
gulp.watch([config.assets.frontend.styles], ['frontend:sass']);
gulp.watch([config.assets.frontend.scripts], ['frontend:js']);
gulp.watch([config.assets.admin.styles], ['admin:sass']);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
},
"config": {
"assets": {
"images": "./assets/images/*",
"images": "./assets/images/**/*",
"imagesrelative": "assets/images/**/*",
"frontend": {
"scripts": "./assets/frontend/js/*.js",
"styles": "./assets/frontend/styles/**/*.scss",
Expand Down

0 comments on commit 3d7fe29

Please sign in to comment.