-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
34 lines (29 loc) · 1018 Bytes
/
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
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 build / npx gulp build: all of the above
exports.build = build = gulp.series pug, coffee
## 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'],
ignoreInitial: false
, coffee
exports.default = pug