-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.coffee
49 lines (40 loc) · 1.32 KB
/
gulpfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
'use strict'
# -- Dependencies --------------------------------------------------------------
gulp = require 'gulp'
coffeeify = require 'coffeeify'
gutil = require 'gulp-util'
browserify = require 'browserify'
header = require 'gulp-header'
uglify = require 'gulp-uglify'
buffer = require 'vinyl-buffer'
pkg = require './package.json'
source = require 'vinyl-source-stream'
# -- Files ---------------------------------------------------------------------
src =
main: './index.js'
module =
filename : "#{pkg.name}.js"
shortcut : "#{pkg.name}"
dist : 'dist'
banner = [
"/**"
" * <%= pkg.name %> - <%= pkg.description %>"
" * @version v<%= pkg.version %>"
" * @link <%= pkg.homepage %>"
" * @license <%= pkg.license %>"
" */"].join("\n")
# -- Tasks ---------------------------------------------------------------------
gulp.task 'browserify', ->
browserify extensions: ['.coffee', '.js']
.transform coffeeify, global: true
.require(src.main, { expose: module.shortcut})
.ignore('coffee-script')
.bundle().on('error', gutil.log)
.pipe source module.filename
.pipe buffer()
.pipe uglify()
.pipe header banner, pkg: pkg
.pipe gulp.dest module.dist
gulp.task 'default', ->
gulp.start 'browserify'
return