This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/web/themes/dcb2017/gulpfile.js
2017-03-31 12:22:46 +01:00

47 lines
994 B
JavaScript

/**
* @file gulpfile.js
*
* Provides gulp tasks for building theme components.
*/
'use strict';
var gulp = require('gulp'),
sass = require('gulp-sass'),
prefix = require('gulp-autoprefixer'),
sourcemaps = require('gulp-sourcemaps');
/**
* @task sass
*
* Compile css from scss.
*/
gulp.task('sass', function () {
return gulp.src('sass/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({
// Include the bootstrap library.
//includePaths: ['./node_modules/bootstrap-sass/assets/stylesheets']
}))
.pipe(prefix(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], { cascade: true }))
.pipe(sourcemaps.write(''))
.pipe(gulp.dest('css'));
});
/**
* @task watch
*
* Watch scss files for changes & recompile.
*/
gulp.task('watch', function () {
gulp.watch(['sass/*.scss', 'sass/**/*.scss'], ['sass']);
});
/**
* @task default
*
* Default task, running just `gulp` will
* compile & watch files.
*/
gulp.task('default', ['sass', 'watch']);