-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (39 loc) · 1.12 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
var gulp = require('gulp');
var browserify = require('browserify');
var babel = require('babelify');
var react = require('react');
var concat = require("concat");
var fs = require("fs");
var source = require('vinyl-source-stream');
var uglify = require("gulp-uglify");
var jshint = require('jshint');
var jshintStylish = require('jshint-stylish');
// var sourcemaps = require('gulp-sourcemaps');
// var source = require('vinyl-source-stream');
// var buffer = require('vinyl-buffer');
// var watchify = require('watchify');
var path = {
js: ["./src/**/*.jsx"],
dest: "./build",
indexHtml: './src/index.html'
};
gulp.task("html", function() {
return gulp
.src([path.indexHtml])
.pipe(gulp.dest(path.dest));
});
gulp.task("js", function() {
return browserify({
entries: "./src/index.jsx",
debug: true
})
.transform("babelify", {presets: ["es2015", "react"]}).bundle()
// .pipe(jshint())
// .pipe(jshint.reporter(jshintStylish))
.pipe(source("bundle.js"))
// .pipe(uglify())
// .pipe(concat("bundle.js"))
.pipe(gulp.dest(path.dest))
// .pipe(fs.createWriteStream("bundle.js"));
});
gulp.task("default", ["html", "js"]);