Skip to content

Commit

Permalink
Updated Gulpfile to address revsions from introduction of the touch c…
Browse files Browse the repository at this point in the history
…ommand, this cleans things up. Fixes JeremyEnglert#387
  • Loading branch information
Garrett Hyder committed Dec 10, 2018
1 parent 4419316 commit 8f4e897
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var gulp = require('gulp'),
// Modify these variables to match your project needs

// Set local URL if using Browser-Sync
const LOCAL_URL = 'http://jointswp-github.dev/';
const LOCAL_URL = 'http://jointswp.local/';

// Set path to Foundation files
const FOUNDATION = 'node_modules/foundation-sites';
Expand Down Expand Up @@ -107,6 +107,7 @@ gulp.task('scripts', function() {
.pipe(plugin.uglify())
.pipe(plugin.sourcemaps.write('.')) // Creates sourcemap for minified JS
.pipe(gulp.dest(ASSETS.scripts))
.pipe(touch());
});

// Compile Sass, Autoprefix and minify
Expand All @@ -129,17 +130,15 @@ gulp.task('styles', function() {
.pipe(plugin.cssnano({safe: true, minifyFontValues: {removeQuotes: false}}))
.pipe(plugin.sourcemaps.write('.'))
.pipe(gulp.dest(ASSETS.styles))
.pipe(touch())
.pipe(browserSync.reload({
stream: true
}));
.pipe(touch());
});

// Optimize images, move into assets directory
gulp.task('images', function() {
return gulp.src(SOURCE.images)
.pipe(plugin.imagemin())
.pipe(gulp.dest(ASSETS.images))
.pipe(touch());
});

gulp.task( 'translate', function () {
Expand All @@ -163,9 +162,9 @@ gulp.task('browsersync', function() {
proxy: LOCAL_URL,
});

gulp.watch(SOURCE.styles, gulp.parallel('styles'));
gulp.watch(SOURCE.styles, gulp.parallel('styles')).on('change', browserSync.reload);
gulp.watch(SOURCE.scripts, gulp.parallel('scripts')).on('change', browserSync.reload);
gulp.watch(SOURCE.images, gulp.parallel('images'));
gulp.watch(SOURCE.images, gulp.parallel('images')).on('change', browserSync.reload);

});

Expand All @@ -184,4 +183,4 @@ gulp.task('watch', function() {
});

// Run styles, scripts and foundation-js
gulp.task('default', gulp.parallel('styles', 'scripts', 'images'));
gulp.task('default', gulp.parallel('styles', 'scripts', 'images'));

0 comments on commit 8f4e897

Please sign in to comment.