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 del = require('del');
|
||||
var cleanCSS = require('gulp-clean-css');
|
||||
var gulpSequence = require('gulp-sequence')
|
||||
|
||||
|
||||
// Run:
|
||||
|
@ -98,7 +99,7 @@ gulp.task('watch-scss', ['browser-sync'], function () {
|
|||
// Run:
|
||||
// gulp sass
|
||||
// Compiles SCSS files in CSS
|
||||
gulp.task('sass', ['minify-css'], function () {
|
||||
gulp.task('sass', function () {
|
||||
var stream = gulp.src('./sass/*.scss')
|
||||
.pipe(plumber({
|
||||
errorHandler: function (err) {
|
||||
|
@ -117,8 +118,7 @@ gulp.task('sass', ['minify-css'], function () {
|
|||
// 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', ['minify-css']);
|
||||
gulp.watch('./sass/**/*.scss', ['styles']);
|
||||
gulp.watch([basePaths.dev + 'js/**/*.js','js/**/*.js','!js/theme.js','!js/theme.min.js'], ['scripts']);
|
||||
|
||||
//Inside the watch task.
|
||||
|
@ -155,7 +155,7 @@ gulp.task('cssnano', function(){
|
|||
|
||||
gulp.task('minify-css', function() {
|
||||
return gulp.src('./css/theme.css')
|
||||
.pipe(cleanCSS({compatibility: 'ie8'}))
|
||||
.pipe(cleanCSS({compatibility: '*'}))
|
||||
.pipe(plumber({
|
||||
errorHandler: function (err) {
|
||||
console.log(err);
|
||||
|
@ -172,6 +172,8 @@ gulp.task('cleancss', function() {
|
|||
.pipe(rimraf());
|
||||
});
|
||||
|
||||
gulp.task('styles', gulpSequence('sass', 'minify-css'))
|
||||
|
||||
|
||||
// Run:
|
||||
// gulp browser-sync
|
||||
|
|
|
@ -48,9 +48,7 @@
|
|||
"gulp-watch": "^4.3.11",
|
||||
"merge2": "^1.0.3",
|
||||
"run-sequence": "^1.2.2",
|
||||
|
||||
"gulp-sequence": "^0.4.6",
|
||||
"undescores-for-npm": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue