-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.coffee
42 lines (34 loc) · 1.06 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
gulp= require "gulp"
rev=require 'gulp-rev'
fs = require 'fs'
override=require 'gulp-rev-css-url'
jade = require 'gulp-jade'
rename = require 'gulp-rename'
_ = require 'lodash'
template = require 'gulp-template'
gulp.task 'rev',()->
return gulp.src('./app/**/*')
.pipe(rev())
.pipe(override())
.pipe(gulp.dest('./dist/'))
.pipe(rev.manifest())
.pipe(gulp.dest('./dist/'))
gulp.task 'revHtml',["rev"], ()->
manifest = JSON.parse(fs.readFileSync('./dist/rev-manifest.json', 'utf8'))
statics =
assetPath : "./app",
manifest : manifest
return gulp.src("./app/**/*.html")
.pipe template statics
.pipe gulp.dest './dist/'
gulp.task 'revJade',["rev"], ()->
manifest = JSON.parse(fs.readFileSync('./dist/rev-manifest.json', 'utf8'));
statics =
assetPath : "./app",
manifest : manifest
return gulp.src('index.jade')
.pipe jade
locals: statics,
pretty: true
.pipe(gulp.dest('./dist/'))
gulp.task 'default', ["revJade"]