Skip to content

Instantly share code, notes, and snippets.

@rodleviton
Last active August 29, 2015 14:01
Show Gist options
  • Save rodleviton/e3f903612e14584af9b9 to your computer and use it in GitHub Desktop.
Save rodleviton/e3f903612e14584af9b9 to your computer and use it in GitHub Desktop.
Basic gulp file to get project up and running
var gulp = require('gulp'),
minifycss = require('gulp-minify-css'),
autoprefixer = require('gulp-autoprefixer'),
notify = require('gulp-notify'),
sass = require('gulp-ruby-sass'),
rename = require('gulp-rename');
gulp.task('css', function() {
return gulp.src('public/assets/sass/application.scss')
.pipe(sass({ style: 'expanded' }))
.pipe(autoprefixer())
.pipe(gulp.dest('public/css'))
.pipe(rename({suffix: '.min'}))
.pipe(minifycss())
.pipe(gulp.dest('public/css'))
.pipe(notify({ message: 'CSS compiled successfully!' }));
});
gulp.task('default', function() {
gulp.run('css');
gulp.watch('public/assets/sass/**/*.scss', function() {
gulp.run('css');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment