This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
require('./tasks-css'); | |
require('./tasks-js'); | |
// etc. | |
gulp.task('dev', ['browsersync', 'html-watch', 'img-watch', 'css-watch', 'js-watch']); | |
gulp.task('dist', ['clean', 'html-compile', 'img-optimize', 'css-compile', 'js-transpile']); | |
// etc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = require('./config'); | |
var gulp = require('gulp'); | |
var watch = require('gulp-watch'); | |
var sass = require('gulp-sass'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var postcss = require('gulp-postcss'); | |
var autoprefixer = require('autoprefixer'); | |
/** | |
* Task: CSS Compile | |
*/ | |
gulp.task('css-compile', function() { | |
gulp.src(config.paths.css.globStatic) | |
.pipe(sourcemaps.init()) | |
.pipe(sass().on('error', sass.logError)) | |
.pipe(postcss([autoprefixer()]])) | |
.pipe(minifyCss()) | |
.pipe(sourcemaps.write('.')) | |
.pipe(gulp.dest(config.paths.css.dirDist)); | |
}); | |
/** | |
* Task: CSS Watch | |
*/ | |
gulp.task('css-watch', ['css-compile'], function() { | |
watch([config.paths.css.globWatch], function() { | |
gulp.start(['css-compile']); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment