Skip to content

Instantly share code, notes, and snippets.

@azeemhassni
Created November 1, 2015 14:24
Show Gist options
  • Save azeemhassni/13d0f13f57dfc79947bb to your computer and use it in GitHub Desktop.
Save azeemhassni/13d0f13f57dfc79947bb to your computer and use it in GitHub Desktop.
Themes Gulpfile
/**
* Almost every project of mine shares the same gulp file.
* that's why i crated a gist for it.
*
* */
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
minify = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
postcss = require('gulp-postcss'),
lost = require('lost'),
maps = require('gulp-sourcemaps');
gulp.task('sass', function () {
return sass('sass', {'sourcemap': true})
.pipe(maps.init())
.pipe(postcss([
lost()
]))
.pipe(minify())
.pipe(maps.write('maps'))
.pipe(gulp.dest('assets/css'));
});
gulp.task('js', function () {
return gulp.src('libs/*.js')
.pipe(concat('all.js'))
.pipe(uglify())
.pipe(gulp.dest('assets/js/'));
});
gulp.task('watch', function () {
gulp.watch('sass/**/*.scss', ['sass']);
gulp.watch('libs/**/*.js', ['js']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment