From edb2e25fe3baf9a84b5f651722bcc5ad0c9e9000 Mon Sep 17 00:00:00 2001 From: koenemann Date: Thu, 22 Dec 2016 09:55:28 +0100 Subject: [PATCH] cleanup gulpfile.js --- gulpfile.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index c734a92..f22123c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,6 +5,7 @@ var basePaths = { dev: './src/' }; + // browser-sync watched files // automatically reloads the page when files changed var browserSyncWatchFiles = [ @@ -12,6 +13,8 @@ var browserSyncWatchFiles = [ './js/*.min.js', './**/*.php' ]; + + // browser-sync options // see: https://www.browsersync.io/docs/options/ var browserSyncOptions = { @@ -19,6 +22,7 @@ var browserSyncOptions = { notify: false }; + // Defining requirements var gulp = require('gulp'); var plumber = require('gulp-plumber'); @@ -88,6 +92,7 @@ gulp.task('sass', function () { .pipe(gulp.dest('./css')); }); + // Run: // gulp watch // Starts watcher. Watcher runs gulp sass task on changes @@ -97,6 +102,7 @@ gulp.task('watch', function () { gulp.watch([basePaths.dev + 'js/**/*.js'], ['scripts']) }); + // Run: // gulp nanocss // Minifies CSS files @@ -117,6 +123,7 @@ gulp.task('cleancss', function() { .pipe(rimraf()); }); + // Run: // gulp browser-sync // Starts browser-sync task for starting the server. @@ -124,11 +131,13 @@ gulp.task('browser-sync', function() { browserSync.init(browserSyncWatchFiles, browserSyncOptions); }); + // Run: // gulp watch-bs // Starts watcher with browser-sync. Browser-sync reloads page automatically on your browser gulp.task('watch-bs', ['browser-sync', 'watch', 'cssnano', 'scripts'], function () { }); + // Run: // gulp scripts. // Uglifies and concat all JS files into one @@ -163,6 +172,7 @@ gulp.task('scripts', function() { .pipe(gulp.dest('./js/')); }); + // Run: // gulp copy-assets. // Copy all needed dependency assets files from bower_component assets to themes /js, /scss and /fonts folder. Run this task after bower install or bower update @@ -221,6 +231,7 @@ gulp.task('copy-assets', function() { .pipe(gulp.dest(basePaths.dev + '/css')); }); + // Run // gulp dist // Copies the files to the /dist folder for distributon