Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCHR-4049: Upgrade gulp #379

Merged
merged 1 commit into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions civihr_default_theme/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ var sourcemaps = require('gulp-sourcemaps');
var scssLint = require('gulp-scss-lint');
var jshint = require('gulp-jshint');

gulp.task('css:sync', civicrmScssRoot.update);

// CSS.
gulp.task('css', ['css:sync'], function() {
gulp.task('css', gulp.series('css:sync', function buildCSS () {
return gulp.src(config.css.src)
.pipe(glob())
.pipe(plumber({
Expand All @@ -42,11 +44,7 @@ gulp.task('css', ['css:sync'], function() {
.pipe(autoprefix('last 2 versions', '> 1%', 'ie 9', 'ie 10'))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(config.css.dest))
});

gulp.task('css:sync', function(){
civicrmScssRoot.updateSync();
});
}));

// Compress images.
gulp.task('images', function () {
Expand All @@ -60,13 +58,13 @@ gulp.task('images', function () {
});

// Fonts.
gulp.task('fonts', function() {
gulp.task('fonts', function () {
return gulp.src(config.fonts.src)
.pipe(gulp.dest(config.fonts.dest));
});

// Watch task.
gulp.task('watch', function() {
gulp.task('watch', function () {
gulp.watch(config.css.src, ['css']);
gulp.watch(config.images.src, ['images']);
});
Expand All @@ -78,19 +76,19 @@ gulp.task('drush', shell.task([
]));

// SCSS Linting.
gulp.task('scss-lint', function() {
gulp.task('scss-lint', function () {
return gulp.src([config.css.src])
.pipe(scssLint())
.pipe(scssLint.format())
.pipe(scssLint.failOnError());
});

// JS Linting.
gulp.task('js-lint', function() {
gulp.task('js-lint', function () {
return gulp.src(config.js.src)
.pipe(jshint())
.pipe(jshint.reporter('default'));
});

// Default Task
gulp.task('default', ['css', 'fonts']);
gulp.task('default', gulp.series('css', 'fonts'));
Loading