forked from ProLoser/screenwriter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
39 lines (37 loc) · 940 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
37
38
39
var gulp = require('gulp'),
sass = require('gulp-sass'),
plumber = require('gulp-plumber'),
react = require('gulp-react'),
webserver = require('gulp-webserver');
var browserify = require('gulp-browserify');
// var concat = require('gulp-concat');
gulp.task('default', function() {
gulp.src(['**/*.js', '**/*.css', '**/*.html'])
.pipe(webserver({
livereload: true,
open: true,
fallback: 'index.html'
}));
gulp.watch('*.scss', ['sass']);
gulp.watch('*.jsx', ['react']);
});
gulp.task('sass', function() {
gulp.src('*.scss')
.pipe(plumber())
.pipe(sass({
sourceComments: 'map'
}))
.pipe(gulp.dest('.'));
});
gulp.task('react', function() {
gulp.src('*.jsx')
.pipe(plumber())
.pipe(react())
.pipe(gulp.dest('.'));
});
gulp.task('browserify', function() {
gulp.src('*.jsx')
.pipe(browserify({transform: 'reactify'}))
.pipe(concat('script.js'))
.pipe(gulp.dest('.'));
});