Adding some gulp instructions/comments
This commit is contained in:
parent
b09d24edba
commit
69cb9e8355
24
gulpfile.js
24
gulpfile.js
|
@ -17,6 +17,9 @@ var ignore = require('gulp-ignore');
|
||||||
var rimraf = require('gulp-rimraf');
|
var rimraf = require('gulp-rimraf');
|
||||||
|
|
||||||
|
|
||||||
|
// Run:
|
||||||
|
// gulp sass
|
||||||
|
// Compiles SCSS files in CSS
|
||||||
gulp.task('sass', function () {
|
gulp.task('sass', function () {
|
||||||
gulp.src('./sass/*.scss')
|
gulp.src('./sass/*.scss')
|
||||||
.pipe(plumber())
|
.pipe(plumber())
|
||||||
|
@ -24,11 +27,19 @@ gulp.task('sass', function () {
|
||||||
.pipe(gulp.dest('./css'));
|
.pipe(gulp.dest('./css'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Run:
|
||||||
|
// gulp watch
|
||||||
|
// Starts watcher. Watcher runs gulp sass task on changes
|
||||||
gulp.task('watch', function () {
|
gulp.task('watch', function () {
|
||||||
gulp.watch('./sass/**/*.scss', ['sass']);
|
gulp.watch('./sass/**/*.scss', ['sass']);
|
||||||
gulp.watch('./css/theme.css', ['minifycss']);
|
gulp.watch('./css/theme.css', ['minifycss']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Run:
|
||||||
|
// gulp minifycss
|
||||||
|
// Minifies CSS files
|
||||||
gulp.task('minifycss', ['cleancss'], function(){
|
gulp.task('minifycss', ['cleancss'], function(){
|
||||||
return gulp.src('./css/*.css')
|
return gulp.src('./css/*.css')
|
||||||
.pipe(plumber())
|
.pipe(plumber())
|
||||||
|
@ -36,7 +47,6 @@ gulp.task('minifycss', ['cleancss'], function(){
|
||||||
.pipe(minifyCSS({keepBreaks:false}))
|
.pipe(minifyCSS({keepBreaks:false}))
|
||||||
.pipe(gulp.dest('./css/'));
|
.pipe(gulp.dest('./css/'));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('cleancss', function() {
|
gulp.task('cleancss', function() {
|
||||||
return gulp.src('./css/*.min.css', { read: false }) // much faster
|
return gulp.src('./css/*.min.css', { read: false }) // much faster
|
||||||
.pipe(ignore('theme.css'))
|
.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 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.task('copy-assets', function() {
|
||||||
gulp.src(basePaths.bower + 'bootstrap-sass/assets/javascripts/**/*.js')
|
gulp.src(basePaths.bower + 'bootstrap-sass/assets/javascripts/**/*.js')
|
||||||
.pipe(gulp.dest('./js'));
|
.pipe(gulp.dest('./js'));
|
||||||
|
|
||||||
|
// Copy all Bootstrap SCSS files
|
||||||
gulp.src(basePaths.bower + 'bootstrap-sass/assets/stylesheets/**/*.scss')
|
gulp.src(basePaths.bower + 'bootstrap-sass/assets/stylesheets/**/*.scss')
|
||||||
.pipe(gulp.dest('./sass/bootstrap-sass'));
|
.pipe(gulp.dest('./sass/bootstrap-sass'));
|
||||||
|
|
||||||
|
// Copy all Bootstrap Fonts
|
||||||
gulp.src(basePaths.bower + 'bootstrap-sass/assets/fonts/bootstrap/*.{ttf,woff,woff2,eof,svg}')
|
gulp.src(basePaths.bower + 'bootstrap-sass/assets/fonts/bootstrap/*.{ttf,woff,woff2,eof,svg}')
|
||||||
.pipe(gulp.dest('./fonts'));
|
.pipe(gulp.dest('./fonts'));
|
||||||
|
|
||||||
|
// Copy all Font Awesome Fonts
|
||||||
gulp.src(basePaths.bower + 'fontawesome/fonts/**/*.{ttf,woff,woff2,eof,svg}')
|
gulp.src(basePaths.bower + 'fontawesome/fonts/**/*.{ttf,woff,woff2,eof,svg}')
|
||||||
.pipe(gulp.dest('./fonts'));
|
.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'));
|
.pipe(gulp.dest('./sass/fontawesome'));
|
||||||
|
|
||||||
|
// Copy jQuery
|
||||||
gulp.src(basePaths.bower + 'jquery/dist/*.js')
|
gulp.src(basePaths.bower + 'jquery/dist/*.js')
|
||||||
.pipe(gulp.dest('./js'));
|
.pipe(gulp.dest('./js'));
|
||||||
|
|
||||||
|
// _s JS files
|
||||||
gulp.src(basePaths.bower + '_s/js/*.js')
|
gulp.src(basePaths.bower + '_s/js/*.js')
|
||||||
.pipe(gulp.dest('./js'));
|
.pipe(gulp.dest('./js'));
|
||||||
});
|
});
|
Reference in New Issue