From 69cb9e8355feccd80a5ee7ef01f4e906b543617a Mon Sep 17 00:00:00 2001 From: koenemann Date: Mon, 18 Jan 2016 14:57:52 +0100 Subject: [PATCH] Adding some gulp instructions/comments --- gulpfile.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 2716445..e112a6e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -17,6 +17,9 @@ var ignore = require('gulp-ignore'); var rimraf = require('gulp-rimraf'); +// Run: +// gulp sass +// Compiles SCSS files in CSS gulp.task('sass', function () { gulp.src('./sass/*.scss') .pipe(plumber()) @@ -24,11 +27,19 @@ gulp.task('sass', function () { .pipe(gulp.dest('./css')); }); + +// Run: +// gulp watch +// Starts watcher. Watcher runs gulp sass task on changes gulp.task('watch', function () { gulp.watch('./sass/**/*.scss', ['sass']); gulp.watch('./css/theme.css', ['minifycss']); }); + +// Run: +// gulp minifycss +// Minifies CSS files gulp.task('minifycss', ['cleancss'], function(){ return gulp.src('./css/*.css') .pipe(plumber()) @@ -36,7 +47,6 @@ gulp.task('minifycss', ['cleancss'], function(){ .pipe(minifyCSS({keepBreaks:false})) .pipe(gulp.dest('./css/')); }); - gulp.task('cleancss', function() { return gulp.src('./css/*.min.css', { read: false }) // much faster .pipe(ignore('theme.css')) @@ -44,26 +54,36 @@ gulp.task('cleancss', function() { }); +// 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 + +// Copy all Bootstrap JS files gulp.task('copy-assets', function() { gulp.src(basePaths.bower + 'bootstrap-sass/assets/javascripts/**/*.js') .pipe(gulp.dest('./js')); +// Copy all Bootstrap SCSS files gulp.src(basePaths.bower + 'bootstrap-sass/assets/stylesheets/**/*.scss') .pipe(gulp.dest('./sass/bootstrap-sass')); +// Copy all Bootstrap Fonts gulp.src(basePaths.bower + 'bootstrap-sass/assets/fonts/bootstrap/*.{ttf,woff,woff2,eof,svg}') .pipe(gulp.dest('./fonts')); +// Copy all Font Awesome Fonts gulp.src(basePaths.bower + 'fontawesome/fonts/**/*.{ttf,woff,woff2,eof,svg}') .pipe(gulp.dest('./fonts')); - gulp.src(basePaths.bower + 'fontawesome/scss/*.scss') +// Copy all Font Awesome SCSS files + gulp.src(basePaths.bower + 'fontawesome/scss/*.scss') .pipe(gulp.dest('./sass/fontawesome')); +// Copy jQuery gulp.src(basePaths.bower + 'jquery/dist/*.js') .pipe(gulp.dest('./js')); +// _s JS files gulp.src(basePaths.bower + '_s/js/*.js') .pipe(gulp.dest('./js')); -}); +}); \ No newline at end of file