-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
68 lines (52 loc) · 1.39 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
gulp = require "gulp"
$ = do require "gulp-load-plugins"
_ = require "lodash"
webpackConfig = require "./webpack.config.coffee"
webpackProductConfig = _.extend {}, webpackConfig, webpackConfig.__product
buildDest = "./build/source/dist"
gulp.task "webpack", ->
gulp
.src "./src"
.pipe $.webpack webpackConfig
.pipe gulp.dest "./dist"
gulp.task "jade", ->
gulp
.src "./src/jade/index.jade"
.pipe $.jade()
.pipe gulp.dest "./dist"
gulp.task "stylus", ->
gulp
.src "./src/stylus/style.styl"
.pipe $.stylus()
.pipe gulp.dest "./dist"
gulp.task "default", ->
$.watch "./src/**/*.+(coffee|jade)", ->
gulp.start "webpack"
$.watch "./src/jade/index.jade", ->
gulp.start "jade"
$.watch "./src/stylus/style.styl", ->
gulp.start "stylus"
gulp.start "webpack"
gulp.start "jade"
gulp.start "stylus"
gulp.task "build-webpack", ->
gulp
.src "./src"
.pipe $.webpack webpackProductConfig
.pipe gulp.dest buildDest
gulp.task "build-stylus", ->
gulp
.src "./src/stylus/style.styl"
.pipe $.stylus
compress: true
.pipe gulp.dest buildDest
gulp.task "build-jade", ->
gulp
.src "./dist/index.html"
.pipe gulp.dest buildDest
gulp.task "build-main", ->
gulp
.src "./main.js"
.pipe $.uglify()
.pipe gulp.dest "./build/source"
gulp.task "build", ["build-webpack", "build-stylus", "build-jade", "build-main"]