forked from CaryLandholt/ng-classify
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.coffee
49 lines (41 loc) · 1.21 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
CHANGELOG_FILE = 'CHANGELOG.md'
browserify = require 'gulp-browserify'
conventionalChangelog = require 'conventional-changelog'
fs = require 'fs'
gulp = require 'gulp'
gutil = require 'gulp-util'
insert = require 'gulp-insert'
jasmine = require 'gulp-jasmine'
pkg = require './package.json'
rename = require 'gulp-rename'
gulp.task 'bundle', ->
options =
extensions: [
'.coffee'
]
transform: [
'coffeeify'
]
gulp
.src 'index.coffee', {cwd: './', read: false}
.pipe browserify options
.pipe rename 'ng-classify-commonjs.js'
.pipe insert.prepend 'module.exports = '
.pipe insert.prepend "// ng-classify v#{pkg.version}\n"
.pipe insert.append '(1)'
.pipe gulp.dest './dist/'
gulp.task 'changelog', ['bundle'], ->
options =
repository : pkg.repository.url
version : pkg.version
file : CHANGELOG_FILE
log : gutil.log
conventionalChangelog options, (err, log) ->
fs.writeFile CHANGELOG_FILE, log
gulp.task 'default', ['test']
gulp.task 'test', ->
options =
verbose: true
gulp
.src '**/*.spec.coffee', cwd: 'test/'
.pipe jasmine options