forked from inkitt/epubjs-rn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
66 lines (56 loc) · 1.67 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
55
56
57
58
59
60
61
62
63
64
65
66
var gulp = require("gulp");
var gutil = require('gulp-util');
var babel = require("gulp-babel");
var plumber = require('gulp-plumber');
var onError = function (err) {
gutil.log(err);
};
gulp.task("build", function () {
return gulp.src(["./src/**/*.js"])
.pipe(plumber({ errorHandler: onError }))
.pipe(babel({
"plugins": [
"syntax-jsx",
["module-resolver", {
"alias": {
"stream": "stream-browserify",
"path": "path-webpack"
}
}],
"static-fs"
]
}
))
.pipe(gulp.dest("components"));
});
gulp.task("copy", ["build"], function () {
return gulp.src(['./components/**/*.js'])
.pipe(gulp.dest("./EpubReader/node_modules/epubjs-rn/components"));
});
gulp.task("copy:package", function () {
return gulp.src(['./package.json'])
.pipe(gulp.dest("./EpubReader/node_modules/epubjs-rn"));
});
gulp.task("copy:epubjs", function () {
return gulp.src(['../epub.js/lib/**/*.js'])
.pipe(gulp.dest("./EpubReader/node_modules/epubjs/lib"));
});
gulp.task("copy:epubjs-src", function () {
return gulp.src(['../epub.js/src/**/*.js'])
.pipe(gulp.dest("./node_modules/epubjs/src"));
});
gulp.task("copy:epubjs-lib", function () {
return gulp.src(['../epub.js/lib/**/*.js'])
.pipe(gulp.dest("./node_modules/epubjs/lib"));
});
gulp.task("copy:contents", function () {
return gulp.src(['./contents/contents.js','./contents/contents.min.js'])
.pipe(gulp.dest("./EpubReader/node_modules/epubjs-rn/contents"));
});
gulp.task("watch", function () {
return gulp.watch('./src/**/*.js', ['build', 'copy', 'copy:package']);
});
gulp.task("watch:epubjs", function () {
return gulp.watch('../epub.js/lib/**/*.js', ['copy:epubjs']);
});
gulp.task("default", ["build"]);