-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.ls
80 lines (63 loc) · 1.8 KB
/
Gulpfile.ls
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
75
76
77
78
79
80
require! {
\fs
\mkdirp
\gulp
\querystring
\gulp-less
\gulp-jade
\gulp-rename
\gulp-postcss
\gulp-browserify
\js-yaml
\autoprefixer
}
var catalog-data
gulp.task \css ->
gulp.src \assets/style.less base: \.
.pipe gulp-less!
.pipe gulp-postcss [autoprefixer browsers: ['> 1%']]
.pipe gulp.dest \src
gulp.task \css-index ->
gulp.src \assets/index.less base: \.
.pipe gulp-less!
.pipe gulp-postcss [autoprefixer browsers: ['> 1%']]
.pipe gulp.dest \.
gulp.task \js ->
gulp.src \assets/*.js base: \.
.pipe gulp-browserify!
.pipe gulp.dest \src
gulp.task \html <[catalog]> ->
gulp.src \assets/*.jade
.pipe gulp-jade locals:
catalog: catalog-data
qs: querystring
.pipe gulp.dest \.
gulp.task \catalog (done) ->
fs.read-file \assets/catalog.yml \utf8 (error, text) ->
return done error if error
try
data = js-yaml.safe-load text
catch
return done e
catalog-data := data
json = JSON.stringify data, null ' '
mkdirp \src/assets (err) ->
return done error if error
fs.write-file \src/assets/catalog.json json, \utf8 (error, text) ->
if error
return done error
else
return done!
gulp.task \dist-pub <[assets]> ->
gulp.src <[src/**/*.@(html|js|css|svg|png|jpeg|jpg|json|pdf) !src/**/*.web.* !**/math/*]> base: \src
.pipe gulp.dest \dist/pub
gulp.task \dist-webimage <[dist-pub]> ->
gulp.src <[src/**/*.web.@(png|jpeg|jpg)]> base: \src
.pipe gulp-rename -> it.basename .= replace /\.web$/ ''
.pipe gulp.dest \dist/pub
gulp.task \dist-root <[assets]> ->
gulp.src <[index.html assets/*.@(css|eot|svg|ttg|woff) images/*]> base: \.
.pipe gulp.dest \dist
gulp.task \assets <[js css css-index html catalog]>
gulp.task \dist <[dist-pub dist-webimage dist-root]>
gulp.task \default [\assets]