-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgulpfile.babel.js
44 lines (36 loc) · 1.01 KB
/
gulpfile.babel.js
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
import gulp from 'gulp'
import babel from 'gulp-babel'
import cached from 'gulp-cached'
import chmod from 'gulp-chmod'
import stylus from 'gulp-stylus'
gulp.task('js-bin', () =>
gulp
.src('./bin/*.js')
.pipe(cached('bin'))
.pipe(babel())
.pipe(chmod(755))
.pipe(gulp.dest('./dist/bin'))
)
gulp.task('js-client', () =>
gulp
.src('./assets/app.js')
.pipe(babel())
.pipe(cached('clientjs'))
.pipe(gulp.dest('./dist/assets'))
)
gulp.task('stylus', () =>
gulp.src('./assets/*.styl').pipe(stylus()).pipe(gulp.dest('./dist/assets'))
)
gulp.task('other-assets', () =>
gulp.src('./assets/favicon.ico').pipe(gulp.dest('./dist/assets'))
)
gulp.task('watch-js', () => {
gulp.watch('./bin/*.js', ['js-bin'])
gulp.watch('./assets/*.js', ['js-client'])
})
gulp.task('watch-stylus', () => {
gulp.watch('./assets/*.styl', ['stylus'])
})
gulp.task('watch', ['watch-js', 'watch-stylus'])
gulp.task('build', ['js-bin', 'js-client', 'stylus', 'other-assets'])
gulp.task('default', ['build', 'watch'])