forked from max-holland/Peeves
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.coffee
74 lines (62 loc) · 2.23 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
"use strict"
## -- Dependencies -------------------------------------------------------------
gulp = require 'gulp'
gutil = require 'gulp-util'
concat = require 'gulp-concat'
header = require 'gulp-header'
uglify = require 'gulp-uglify'
pkg = require './package.json'
less = require 'gulp-less'
cssmin = require 'gulp-cssmin'
autoprefixer = require 'gulp-autoprefixer'
livereload = require 'gulp-livereload'
## -- Files --------------------------------------------------------------------
source =
js : [
"assets/js/init.main.js"
"assets/js/init.highlight.js"
]
less : "assets/less/__init.less"
dependencies =
js: [
"assets/vendor/parrotjs/dist/parrot.standalone.js"
"assets/vendor/parrot-module-device/dist/parrot.device.js"
"assets/vendor/jquery-backstretch/jquery.backstretch.min.js"
"assets/vendor/imagesloaded/imagesloaded.pkgd.min.js"
"assets/vendor/reading-time/build/readingTime.min.js"
"assets/vendor/fitvids/jquery.fitvids.js"
"assets/vendor/fluidbox/jquery.fluidbox.min.js"
"assets/vendor/jquery-infinite-scroll/jquery.infinitescroll.min.js"
"assets/vendor/pace/pace.min.js"
"assets/js/highlight.pack.js"
]
banner = [
"/**"
" * Peeves <%= pkg.description %>"
" * @version v<%= pkg.version %>"
" * @homepage <%= pkg.homepage %>"
" * @license <%= pkg.license %>"
" */"
""].join("\n")
# -- TASKS ---------------------------------------------------------------------
gulp.task "less", ->
gulp.src source.less
.pipe less().on('error', gutil.log)
.pipe concat(pkg.name + ".css")
.pipe autoprefixer()
.pipe cssmin()
.pipe header(banner, pkg: pkg)
.pipe gulp.dest('assets/css')
gulp.task "js", ->
gulp.src dependencies.js.concat source.js
.pipe concat(pkg.name + ".js")
.pipe uglify(mangle: false)
.pipe header(banner, pkg: pkg)
.pipe gulp.dest('assets/js')
return
gulp.task "watch", ->
livereload.listen()
gulp.watch("assets/less/**/*.less", ["less"]).on('change', livereload.changed)
gulp.watch("assets/js/init.*.js", ["js"]).on('change', livereload.changed)
gulp.task "build", -> gulp.start ["less", "js"]
gulp.task "default", -> gulp.start ["build", "watch"]