-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.coffee
38 lines (30 loc) · 887 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
35
36
37
38
gulp = require('gulp')
del = require('del')
rename = require('gulp-rename')
webpack = require('webpack-stream')
copy = require('gulp-copy')
connect = require('gulp-connect')
gulp.task 'clean', ->
del(['dist/**/*'])
gulp.task 'webpack', ['clean'], ->
gulp.src('index.coffee')
.pipe(webpack(require('./webpack.config.coffee')))
.pipe(rename('production.js'))
.pipe(gulp.dest('built'))
gulp.task 'copy', ->
gulp.src('index.html')
.pipe(copy('built'))
gulp.task 'watch', ->
gulp.watch ['./*.coffee'], (event) ->
gulp.src(event.path).pipe(connect.reload())
gulp.watch ['./*.coffee'], ['default']
gulp.task 'connect', ->
connect.server
root: ['built']
port: 9010
livereload:
port: 32834
connect:
redirect: false
gulp.task 'default', ['clean', 'webpack', 'copy']
gulp.task 'serve', ['default', 'connect', 'watch']