forked from jariz/vibrant.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
42 lines (35 loc) · 1023 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
38
39
40
41
42
gulp = require 'gulp'
coffee = require 'gulp-coffee'
browserify = require 'browserify'
runSequence = require 'run-sequence'
source = require 'vinyl-source-stream'
del = require 'del'
closureCompiler = require 'gulp-closure-compiler'
gulp.task 'coffee', ->
gulp.src('*.coffee')
.pipe(coffee())
.pipe(gulp.dest('.'))
gulp.src('src/*.coffee')
.pipe(coffee())
.pipe(gulp.dest('src'))
gulp.task 'browserify', ->
browserify(
entries: 'src/Vibrant.js'
)
.bundle()
.pipe(source('Vibrant.js'))
.pipe(gulp.dest('dist'))
gulp.task 'default', ->
runSequence 'coffee', 'browserify', 'cleanup', 'closure'
gulp.task 'cleanup', (cb) ->
del ['src/Vibrant.js'], cb
gulp.task 'closure', ->
gulp.src('dist/Vibrant.js')
.pipe(closureCompiler(
compilerPath: 'bower_components/closure-compiler/lib/vendor/compiler.jar',
fileName: 'Vibrant.min.js',
continueWithWarnings: true
))
.pipe(gulp.dest('dist'));
gulp.task 'watch', ->
gulp.watch ['**/*.coffee'], ['default']