forked from shipshapecode/shepherd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.coffee
93 lines (77 loc) · 2.13 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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')
wrap = require('gulp-wrap-umd')
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/shepherd.js'])
.pipe(concat('shepherd.js'))
.pipe(header(banner))
.pipe(gulp.dest('./'))
gulp.src(['js/shepherd.js'])
.pipe(concat('shepherd-amd.js'))
.pipe(header(banner))
.pipe(gulp.dest('./'))
.pipe(wrap({
namespace: "Shepherd"
exports: "Shepherd"
deps: [
name: 'tether'
globalName: 'Tether'
paramName: 'Tether'
]
}))
.pipe(gulp.dest('./'))
gulp.task 'uglify', ->
gulp.src('./shepherd.js')
.pipe(uglify())
.pipe(header(banner))
.pipe(rename('shepherd.min.js'))
.pipe(gulp.dest('./'))
gulp.src('./shepherd-amd.js')
.pipe(uglify())
.pipe(header(banner))
.pipe(rename('shepherd-amd.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/']
gulp.src("./#{ path }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'