-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
36 lines (30 loc) · 909 Bytes
/
gulpfile.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
var gulp = require('gulp')
var babel = require('gulp-babel')
var watch = require('gulp-watch')
var server = require('gulp-express')
var batch = require('gulp-batch')
var sass = require('gulp-sass')
gulp.task('default', function () {
// place code for your default task here
})
gulp.task('server', ['build'], function () {
// Start the server at the beginning of the task
server.run(['index.js'], {}, false)
gulp.watch('assets/js/*', ['javascript'])
gulp.watch('assets/styles/*', ['styles'])
})
gulp.task('build', ['javascript', 'styles'])
gulp.task('javascript', function () {
var src = 'assets/js/*.js'
gulp.src(src)
.pipe(watch(src))
.pipe(babel())
.pipe(gulp.dest('public/js'))
})
gulp.task('styles', function () {
var src = 'assets/styles/*.scss'
gulp.src(src)
.pipe(watch(src))
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('public/styles'))
})