adding gulp-sequence
This commit is contained in:
parent
ff71842e73
commit
3e3e57df3c
File diff suppressed because one or more lines are too long
10
gulpfile.js
10
gulpfile.js
|
@ -42,6 +42,7 @@ var sourcemaps = require('gulp-sourcemaps');
|
||||||
var browserSync = require('browser-sync').create();
|
var browserSync = require('browser-sync').create();
|
||||||
var del = require('del');
|
var del = require('del');
|
||||||
var cleanCSS = require('gulp-clean-css');
|
var cleanCSS = require('gulp-clean-css');
|
||||||
|
var gulpSequence = require('gulp-sequence')
|
||||||
|
|
||||||
|
|
||||||
// Run:
|
// Run:
|
||||||
|
@ -98,7 +99,7 @@ gulp.task('watch-scss', ['browser-sync'], function () {
|
||||||
// Run:
|
// Run:
|
||||||
// gulp sass
|
// gulp sass
|
||||||
// Compiles SCSS files in CSS
|
// Compiles SCSS files in CSS
|
||||||
gulp.task('sass', ['minify-css'], function () {
|
gulp.task('sass', function () {
|
||||||
var stream = gulp.src('./sass/*.scss')
|
var stream = gulp.src('./sass/*.scss')
|
||||||
.pipe(plumber({
|
.pipe(plumber({
|
||||||
errorHandler: function (err) {
|
errorHandler: function (err) {
|
||||||
|
@ -117,8 +118,7 @@ gulp.task('sass', ['minify-css'], function () {
|
||||||
// gulp watch
|
// gulp watch
|
||||||
// Starts watcher. Watcher runs gulp sass task on changes
|
// 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', ['styles']);
|
||||||
gulp.watch('./css/theme.css', ['minify-css']);
|
|
||||||
gulp.watch([basePaths.dev + 'js/**/*.js','js/**/*.js','!js/theme.js','!js/theme.min.js'], ['scripts']);
|
gulp.watch([basePaths.dev + 'js/**/*.js','js/**/*.js','!js/theme.js','!js/theme.min.js'], ['scripts']);
|
||||||
|
|
||||||
//Inside the watch task.
|
//Inside the watch task.
|
||||||
|
@ -155,7 +155,7 @@ gulp.task('cssnano', function(){
|
||||||
|
|
||||||
gulp.task('minify-css', function() {
|
gulp.task('minify-css', function() {
|
||||||
return gulp.src('./css/theme.css')
|
return gulp.src('./css/theme.css')
|
||||||
.pipe(cleanCSS({compatibility: 'ie8'}))
|
.pipe(cleanCSS({compatibility: '*'}))
|
||||||
.pipe(plumber({
|
.pipe(plumber({
|
||||||
errorHandler: function (err) {
|
errorHandler: function (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
@ -172,6 +172,8 @@ gulp.task('cleancss', function() {
|
||||||
.pipe(rimraf());
|
.pipe(rimraf());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('styles', gulpSequence('sass', 'minify-css'))
|
||||||
|
|
||||||
|
|
||||||
// Run:
|
// Run:
|
||||||
// gulp browser-sync
|
// gulp browser-sync
|
||||||
|
|
|
@ -48,9 +48,7 @@
|
||||||
"gulp-watch": "^4.3.11",
|
"gulp-watch": "^4.3.11",
|
||||||
"merge2": "^1.0.3",
|
"merge2": "^1.0.3",
|
||||||
"run-sequence": "^1.2.2",
|
"run-sequence": "^1.2.2",
|
||||||
|
"gulp-sequence": "^0.4.6",
|
||||||
"undescores-for-npm": "^1.0.0"
|
"undescores-for-npm": "^1.0.0"
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue