Created
January 4, 2015 22:04
-
-
Save destroytoday/8132ad9e25fbf57094e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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