Skip to content

Instantly share code, notes, and snippets.

@frankdejonge
Created October 6, 2014 13:37
Show Gist options
  • Save frankdejonge/a8e999f30f5c95049a43 to your computer and use it in GitHub Desktop.
Save frankdejonge/a8e999f30f5c95049a43 to your computer and use it in GitHub Desktop.
Basic Gulp setup with Sass + Bower + Browserify
var gulp = require('gulp'),
browserify = require('gulp-browserify'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
sass = require('gulp-sass'),
jshint = require('gulp-jshint');
gulp.task('javascript', function () {
return gulp.src('assets/js/*.js')
.pipe(browserify({
transform: ['debowerify']
}))
.pipe(jshint())
.pipe(uglify())
.pipe(rename({extname: '.min.js'}))
.pipe(gulp.dest('public/assets/js'));
});
gulp.task('styles', function () {
return gulp.src('assets/sass/*.scss')
.pipe(sass())
.pipe(gulp.dest('public/assets/css'));
});
gulp.task('build', ['javascript', 'styles']);
gulp.task('default', ['build'], function () {
gulp.watch('assets/js/**/*.js', ['javascript']);
gulp.watch('assets/sass/**/*.scss', ['styles']);
});
{
"name": "some-project",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"debowerify": "^0.8.1",
"gulp": "^3.8.8",
"gulp-browserify": "^0.5.0",
"gulp-jshint": "^1.8.4",
"gulp-rename": "^1.2.0",
"gulp-sass": "^0.7.3",
"gulp-uglify": "^1.0.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment