-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
54 lines (45 loc) · 1.15 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var gulp = require('gulp');
var watch = require('gulp-watch');
var sass = require('gulp-sass');
var shell = require('gulp-shell');
var bs = require('browser-sync');
var nodemon = require('gulp-nodemon');
var paths = {
scripts: ['src/**/*.js'],
styles: ['client/**/*.css']
};
gulp.task('serve', function () {
nodemon({script: 'index.js', ignore: 'node_modules/**/*.js'});
});
gulp.task('start', ['serve'], function () {
bs({
notify: true,
injectChanges: true,
files: paths.scripts.concat(paths.styles),
proxy: 'localhost:8000'
});
});
gulp.task('sass', function () {
gulp.src('./scss/*.scss')
.pipe(sass())
.pipe(gulp.dest('./client/css'));
});
gulp.task('sass-watch', ['sass'], function () {
watch('./scss/*.scss', function () {
gulp.start('sass');
});
});
gulp.task('jsx', shell.task([
'jsx --no-cache-dir jsx/ src/'
]));
gulp.task('jsx-watch', ['jsx'], function () {
watch('./jsx/**/*.js', function () {
gulp.start('jsx');
});
});
gulp.task('browserify', shell.task([
'browserify jsx/Router.js -o client/bundle.js'
]));
gulp.task('watchify', shell.task([
'watchify -d jsx/Router.js -o client/bundle.js -v'
]));