-
Notifications
You must be signed in to change notification settings - Fork 49
/
gulpfile.coffee
54 lines (46 loc) · 1.24 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
gulp = require 'gulp'
del = require 'del'
coffee = require 'gulp-coffee'
coffeelint = require 'gulp-coffeelint'
header = require 'gulp-header'
uglify = require 'gulp-uglify'
rename = require 'gulp-rename'
pjson = require './package.json'
copyright = """
/*!
Non-Sucking Autogrow #{pjson.version}
license: #{pjson.license}
author: Roman Pushkin
#{pjson.homepage}
*/
"""
dest = 'dist/'
source = 'src/'
code =
in: "#{source}*.coffee"
out: "#{dest}"
gulp.task 'clean', ->
del [dest + '*']
gulp.task 'build', ->
gulp
.src code.in
.pipe coffeelint()
.pipe coffeelint.reporter() # Show coffeelint errors
.pipe coffeelint.reporter('fail') # Make sure it fails in case of error
.pipe coffee()
.pipe header copyright
.pipe gulp.dest(code.out)
gulp
.src code.in
.pipe coffeelint()
.pipe coffeelint.reporter() # Show coffeelint errors
.pipe coffeelint.reporter('fail') # Make sure it fails in case of error
.pipe coffee()
.pipe uglify()
.pipe rename({ suffix: '.min' })
.pipe header copyright
.pipe gulp.dest(code.out)
gulp.task 'watch', ->
gulp
.watch code.in, ['build']
gulp.task 'default', ['clean', 'build', 'watch'], ->