forked from mreq/slick-lightbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.coffee
70 lines (52 loc) · 1.65 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'
cssmin = require 'gulp-cssmin'
ecstatic = require 'ecstatic'
gutil = require 'gulp-util'
http = require 'http'
sass = require 'gulp-sass'
shell = require 'gulp-shell'
uglify = require 'gulp-uglifyjs'
wrapJS = require 'gulp-wrap-js'
#############################
gulp.task 'coffee', ->
gulp
.src 'src/scripts/slick-lightbox.coffee'
.pipe coffee( bare: true ).on('error', gutil.log)
.pipe wrapJS("""'use strict';
(function($) {
%= body %
}(jQuery));""")
.pipe gulp.dest 'dist/'
gulp.task 'sass', ->
gulp
.src 'src/styles/slick-lightbox.sass'
.pipe sass(outputStyle: 'compressed').on('error', sass.logError)
.pipe gulp.dest 'dist/'
#############################
gulp.task 'uglify', ->
gulp
.src 'dist/slick-lightbox.js'
.pipe uglify 'slick-lightbox.min.js', outSourceMap: true
.pipe gulp.dest 'dist/'
gulp.task 'coffeedoc', shell.task(['coffeedoc src/scripts/slick-lightbox.coffee'])
gulp.task 'buildGHPages', shell.task(['jade index.jade'])
#############################
gulp.task 'watch', ->
gulp.watch 'src/scripts/*.coffee', ['coffee', 'coffeedoc']
gulp.watch 'src/styles/*.sass', ['sass']
gulp.watch ['index.jade', 'README.md'], ['buildGHPages']
#############################
gulp.task 'base', ->
gulp.start 'coffee', 'coffeedoc', 'sass', 'uglify'
gulp.task 'build', ->
gulp.start 'base', 'buildGHPages'
gulp.task 'server', ->
gulp.start 'base', 'watch'
http
.createServer ecstatic( root: __dirname )
.listen 9000
#############################
gulp.task 'default', ->
gulp.start 'server'