-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
41 lines (35 loc) · 1.27 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
gulp = require 'gulp'
gulpCoffee = require 'gulp-coffee'
gulpPug = require 'gulp-pug'
gulpChmod = require 'gulp-chmod'
child_process = require 'child_process'
## npm run pug / npx gulp pug: builds index.html from index.pug etc.
exports.pug = pug = ->
gulp.src '*.pug'
.pipe gulpPug pretty: false #true
# working around bug that <label> and <input> add extra spaces
# in pretty mode
.pipe gulpChmod 0o644
.pipe gulp.dest './'
## npm run coffee / npx gulp coffee: builds index.js from index.coffee etc.
exports.coffee = coffee = ->
gulp.src '*.coffee', ignore: 'gulpfile.coffee'
.pipe gulpCoffee()
.pipe gulpChmod 0o644
.pipe gulp.dest './'
## npm run font / npx gulp font: builds font.js from allfont.coffee via
## `coffee voronoi.coffee`
exports.font = font = ->
child_process.exec 'coffee voronoi.coffee'
## npm run build / npx gulp build: all of the above
exports.build = build = gulp.series pug, coffee, font
## npm run watch / npx gulp watch: continuously update above
exports.watch = watch = ->
gulp.watch '*.pug', ignoreInitial: false, pug
gulp.watch '*.styl', pug
gulp.watch '*.coffee',
ignore: 'gulpfile.coffee'
ignoreInitial: false
, coffee
gulp.watch ['allfont.coffee', 'voronoi.coffee'], ignoreInitial: false, font
exports.default = pug