-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.ls
More file actions
44 lines (33 loc) · 1.02 KB
/
gulpfile.ls
File metadata and controls
44 lines (33 loc) · 1.02 KB
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
gulp = require \gulp
webpack = require \webpack
stylus = require \gulp-stylus
gutil = require \gulp-util
paths =
ls: \./src/ls/app.ls
lsAll: \./src/ls/*.ls
js: \./extension/js
styl: \./src/styl/main.styl
stylAll: \./src/styl/*.styl
css: \./extension/css
webpack-config = require(\./webpack.config)
gulp.task \webpack, (cb)->
prod-config = Object.create webpack-config
prod-config.plugins = prod-config.plugins.concat new webpack.optimize.UglifyJsPlugin()
webpack prod-config, (err, stats) ->
gutil.log '[webpack]', stats.toString!
cb!
gulp.task \webpack-dev, (cb)->
webpack webpack-config, (err, stats) ->
gutil.log '[webpack]', stats.toString!
cb!
gulp.task \styl, ->
gulp.src paths.styl
.pipe stylus!
.pipe gulp.dest paths.css
gulp.task \watch, ->
gulp.watch paths.lsAll, <[webpack-dev]>
gulp.watch paths.stylAll, <[styl]>
gulp.task \build, <[webpack styl]>
gulp.task \build-dev, <[webpack-dev styl]>
gulp.task \default, <[build watch]>
gulp.task \dev, <[build-dev watch]>