update gulpfile to make SASS default

This commit is contained in:
David Miller 2017-03-01 12:26:48 -05:00
parent 1cd2fada7e
commit ee4604de57
3 changed files with 507 additions and 622 deletions

File diff suppressed because it is too large Load Diff

2
css/agency.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -17,10 +17,10 @@ var banner = ['/*!\n',
'' ''
].join(''); ].join('');
// Compile LESS files from /less into /css // Compiles SCSS files from /scss into /css
gulp.task('less', function() { gulp.task('sass', function() {
return gulp.src('less/agency.less') return gulp.src('scss/agency.scss')
.pipe(less()) .pipe(sass())
.pipe(header(banner, { pkg: pkg })) .pipe(header(banner, { pkg: pkg }))
.pipe(gulp.dest('css')) .pipe(gulp.dest('css'))
.pipe(browserSync.reload({ .pipe(browserSync.reload({
@ -29,7 +29,7 @@ gulp.task('less', function() {
}); });
// Minify compiled CSS // Minify compiled CSS
gulp.task('minify-css', ['less'], function() { gulp.task('minify-css', ['sass'], function() {
return gulp.src('css/agency.css') return gulp.src('css/agency.css')
.pipe(cleanCSS({ compatibility: 'ie8' })) .pipe(cleanCSS({ compatibility: 'ie8' }))
.pipe(rename({ suffix: '.min' })) .pipe(rename({ suffix: '.min' }))
@ -74,7 +74,7 @@ gulp.task('copy', function() {
}) })
// Run everything // Run everything
gulp.task('default', ['less', 'minify-css', 'minify-js', 'copy']); gulp.task('default', ['sass', 'minify-css', 'minify-js', 'copy']);
// Configure the browserSync task // Configure the browserSync task
gulp.task('browserSync', function() { gulp.task('browserSync', function() {
@ -86,8 +86,8 @@ gulp.task('browserSync', function() {
}) })
// Dev task with browserSync // Dev task with browserSync
gulp.task('dev', ['browserSync', 'less', 'minify-css', 'minify-js'], function() { gulp.task('dev', ['browserSync', 'sass', 'minify-css', 'minify-js'], function() {
gulp.watch('less/*.less', ['less']); gulp.watch('scss/*.scss', ['sass']);
gulp.watch('css/*.css', ['minify-css']); gulp.watch('css/*.css', ['minify-css']);
gulp.watch('js/*.js', ['minify-js']); gulp.watch('js/*.js', ['minify-js']);
// Reloads the browser whenever HTML or JS files change // Reloads the browser whenever HTML or JS files change
@ -95,11 +95,10 @@ gulp.task('dev', ['browserSync', 'less', 'minify-css', 'minify-js'], function()
gulp.watch('js/**/*.js', browserSync.reload); gulp.watch('js/**/*.js', browserSync.reload);
}); });
// Compiles SCSS files from /scss into /css // OPTIONAL: LESS task if you prefer to use LESS over SASS
// NOTE: This theme uses LESS by default. To swtich to SCSS you will need to update this gulpfile by changing the 'less' tasks to run 'sass'! gulp.task('less', function() {
gulp.task('sass', function() { return gulp.src('less/agency.less')
return gulp.src('scss/agency.scss') .pipe(less())
.pipe(sass())
.pipe(header(banner, { pkg: pkg })) .pipe(header(banner, { pkg: pkg }))
.pipe(gulp.dest('css')) .pipe(gulp.dest('css'))
.pipe(browserSync.reload({ .pipe(browserSync.reload({