Skip to content

Instantly share code, notes, and snippets.

@davidmerrique
Forked from destroytoday/gulpfile.js
Last active August 29, 2015 14:12
Show Gist options
  • Save davidmerrique/23864df50aaaa01e9e4e to your computer and use it in GitHub Desktop.
Save davidmerrique/23864df50aaaa01e9e4e to your computer and use it in GitHub Desktop.
'use strict';
var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var uglify = require('gulp-uglify');
var coffeeify = require('coffeeify');
var shim = require('browserify-shim');
gulp.task('scripts', function() {
var b = browserify('./app.coffee', {
extensions: ['.js', '.coffee', '.html']
});
b.transform({ global: true }, coffeeify);
b.transform({ global: true }, shim);
return b.bundle()
.on('error', function(error) {
this.emit('end');
})
.pipe(source('app.js'))
.pipe(buffer())
.pipe(uglify())
.pipe(gulp.dest('./public/'))
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment