-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathgulpfile.coffee
More file actions
45 lines (38 loc) · 1.17 KB
/
gulpfile.coffee
File metadata and controls
45 lines (38 loc) · 1.17 KB
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
gulp = require('gulp')
connect = require('gulp-connect')
uglify = require('gulp-uglify')
stylus = require('gulp-stylus')
header = require('gulp-header')
rename = require('gulp-rename')
pkg = require('./package.json')
paths =
scripts: 'angular-loading-button.js'
stylus: 'example/**/*.styl'
banner = """
/**
* <%= pkg.name %> - v<%= pkg.version %>
* <%= pkg.description %>
* <%= pkg.homepage %>
* Licensed <%= pkg.license %>
*/\n
"""
gulp.task 'connect', ->
connect.server
livereload: true
gulp.task 'scripts', ->
gulp.src(paths.scripts)
.pipe(uglify())
.pipe(header(banner, pkg: pkg))
.pipe(rename('angular-loading-button.min.js'))
.pipe(gulp.dest('.'))
.pipe(connect.reload())
gulp.task 'stylus', ->
gulp.src(paths.stylus)
.pipe(stylus(use: require('nib')()))
.pipe(gulp.dest('example'))
.pipe(connect.reload())
gulp.task 'watch', ->
gulp.watch(paths.scripts, ['scripts'])
gulp.watch(paths.stylus, ['stylus'])
gulp.task 'build', ['scripts', 'stylus']
gulp.task 'default', ['scripts', 'stylus', 'connect', 'watch']