Skip to content

Instantly share code, notes, and snippets.

@lukearmstrong
Created December 11, 2014 21:11
Show Gist options
  • Save lukearmstrong/d8817fb6f3122583c7b8 to your computer and use it in GitHub Desktop.
Save lukearmstrong/d8817fb6f3122583c7b8 to your computer and use it in GitHub Desktop.
Sass seemed a bit slow, so just out of curiosity I tried using Less instead.
@import '../../../bower_components/bootstrap/less/bootstrap.less';
@import '../../../bower_components/bootstrap-sass-official/assets/stylesheets/_bootstrap.scss';
luke@samsung:/var/www/test$ time gulp less
[20:58:56] Using gulpfile /var/www/test/gulpfile.js
[20:58:56] Starting 'less'...
[20:58:56] Finished 'less' after 41 ms
[20:58:59] gulp-notify: [Gulp notification] less task complete
real 0m11.752s
user 0m11.244s
sys 0m0.599s
luke@samsung:/var/www/test$ time gulp sass
[20:58:29] Using gulpfile /var/www/test/gulpfile.js
[20:58:29] Starting 'sass'...
[20:58:29] Finished 'sass' after 46 ms
[20:58:30] gulp-ruby-sass: directory
[20:58:41] gulp-ruby-sass: write app.css
write app.css.map
[20:58:42] gulp-notify: [Gulp notification] sass task complete
[20:58:42] gulp-notify: [Gulp notification] sass task complete
real 0m21.199s
user 0m20.381s
sys 0m0.744s
var gulp = require('gulp'),
less = require('gulp-less'),
sass = require('gulp-ruby-sass'),
minifycss = require('gulp-minify-css'),
rename = require('gulp-rename'),
notify = require('gulp-notify');
/*
Convert SASS to CSS and minify.
*/
gulp.task('sass', function() {
gulp.src('resources/assets/sass/app.scss')
.pipe(sass())
.pipe(gulp.dest('public/css'))
.pipe(rename({suffix: '.min'}))
.pipe(minifycss())
.pipe(gulp.dest('public/css'))
.pipe(notify({ message: 'sass task complete' }));
});
/*
Convert LESS to CSS and minify.
*/
gulp.task('less', function () {
gulp.src('resources/assets/less/app.less')
.pipe(less({}))
.pipe(gulp.dest('public/less'))
.pipe(rename({suffix: '.min'}))
.pipe(minifycss())
.pipe(gulp.dest('public/less'))
.pipe(notify({ message: 'less task complete' }));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment