-
Notifications
You must be signed in to change notification settings - Fork 6
/
gulpfile.coffee
37 lines (31 loc) · 890 Bytes
/
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
{full: version} = require './lib/version'
TARGET = "eyetribe-#{version}"
isDevelopment = version.indexOf 'SNAPSHOT' > 0
gulp = require 'gulp'
browserify = require 'browserify'
uglify = require 'gulp-uglify'
source = require 'vinyl-source-stream'
concat = require 'gulp-concat'
gulp.task 'default', ['compress']
gulp.task 'browserify', ->
b = browserify
entries: ['./template/entry.coffee']
extensions: ['.coffee']
debug: true
.transform 'coffeeify'
.bundle (error)->
if error
console.error error
b.end()
.pipe source TARGET + '.js'
.pipe gulp.dest '.'
gulp.task 'compress', ['browserify'], ->
gulp.src TARGET + '.js'
.pipe uglify
outSourceMap: true
.pipe concat TARGET + '.min.js'
.pipe gulp.dest '.'
gulp.task 'watch', ['compress'], ->
gulp.watch 'lib/*.coffee', ['compress']
gulp.task 'server', ['watch'], ->
require './server'