forked from HubSpot/drop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.coffee
70 lines (57 loc) · 1.66 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
gulp = require('gulp')
coffee = require('gulp-coffee')
compass = require('gulp-compass')
concat = require('gulp-concat')
uglify = require('gulp-uglify')
header = require('gulp-header')
rename = require('gulp-rename')
bower = require('gulp-bower')
gutil = require('gulp-util')
pkg = require('./package.json')
banner = "/*! #{ pkg.name } #{ pkg.version } */\n"
gulp.task 'bower', ->
bower().pipe(gulp.dest('./bower_components'))
gulp.task 'coffee', ->
try
gulp.src('./coffee/*')
.pipe(coffee().on('error', gutil.log))
.pipe(gulp.dest('./js/'))
gulp.src('./docs/welcome/coffee/*')
.pipe(coffee())
.pipe(gulp.dest('./docs/welcome/js/'))
catch e
gulp.task 'concat', ->
gulp.src(['./bower_components/tether/tether.js', 'js/drop.js'])
.pipe(concat('drop.js'))
.pipe(header(banner))
.pipe(gulp.dest('./'))
gulp.task 'uglify', ->
gulp.src('./drop.js')
.pipe(uglify())
.pipe(header(banner))
.pipe(rename('drop.min.js'))
.pipe(gulp.dest('./'))
gulp.task 'js', ->
gulp.run 'coffee', ->
gulp.run 'concat', ->
gulp.run 'uglify', ->
gulp.task 'compass', ->
for path in ['', 'docs/welcome/', 'docs/welcome/examples/social-sharing/']
gulp.src("./#{ path }sass/**/*.sass")
.pipe(compass(
sass: "#{ path }sass"
css: "#{ path }css"
comments: false
))
.pipe(gulp.dest("./#{ path }css"))
gulp.task 'default', ->
gulp.run 'bower', ->
gulp.run 'js', 'compass', ->
gulp.watch './**/*.coffee', ->
gulp.run 'js'
gulp.watch './**/*.sass', ->
gulp.run 'compass'
gulp.watch './bower.json', ->
gulp.run 'bower'
gulp.watch './package.json', ->
gulp.run 'js'