-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
55 lines (47 loc) · 1.25 KB
/
gulpfile.js
File metadata and controls
55 lines (47 loc) · 1.25 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
45
46
47
48
49
50
51
52
53
54
55
const gulp = require('gulp');
const sass = require('gulp-sass');
const babel = require('gulp-babel');
const nodemon = require('gulp-nodemon');
const eslint = require('gulp-eslint');
const concat = require('gulp-concat');
gulp.task('sass', () => {
gulp.src('./client/scss/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./hosted/style/'));
});
gulp.task('js', () => {
// Default bundle
gulp.src(['./client/*.js', './client/helper/*.js'])
.pipe(concat('bundle.js'))
.pipe(babel({
presets: ['env', 'react']
}))
.pipe(gulp.dest('./hosted/'));
// App Bundle
gulp.src(['./client/app/*.js', './client/helper/*.js'])
.pipe(concat('appBundle.js'))
.pipe(babel({
presets: ['env', 'react']
}))
.pipe(gulp.dest('./hosted/'));
});
gulp.task('lint', () => {
return gulp.src(['./server/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('watch', () => {
gulp.watch('./client/scss/*.scss', ['sass']);
gulp.watch(['./client/*.js', './client/**/*.js'], ['js']);
nodemon({
script: './server/app.js'
, ext: 'js'
, tasks: ['lint']
})
});
gulp.task('build', () => {
gulp.start('sass');
gulp.start('js');
gulp.start('lint');
});