Skip to content

Instantly share code, notes, and snippets.

@wtnabe
Last active August 29, 2015 14:23
Show Gist options
  • Save wtnabe/c4b198fdc1bd70d00b87 to your computer and use it in GitHub Desktop.
Save wtnabe/c4b198fdc1bd70d00b87 to your computer and use it in GitHub Desktop.
gulp + browserify + uglify practice
gulp = require 'gulp'
source = require 'vinyl-source-stream'
buffer = require 'vinyl-buffer'
uglify = require 'gulp-uglify'
watch = require 'gulp-watch'
browserify = require 'browserify'
gulp.task 'browserify', ->
browserify
entries: ['./libraries.coffee']
extensions: ['.coffee', '.js']
.transform 'coffeeify'
.bundle()
.pipe source 'bundle.js'
.pipe buffer()
.pipe uglify(output: {comments: /^!|@preserve|@licence|@cc_on/i})
.pipe gulp.dest './app/assets/javascripts/'
gulp.task 'default', ['browserify']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment