-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
37 lines (33 loc) · 1.21 KB
/
gulpfile.js
File metadata and controls
37 lines (33 loc) · 1.21 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
var gulp = require("gulp");
var tasks = [];
// TypeScript
var ts = require("gulp-typescript");
gulp.task("typescript", function() {
var tsResult = gulp.src([ "**/*.ts", "!node_modules/**" ]).pipe(ts({
typescript: require("typescript"),
noImplicitAny: true,
declarationFiles: false,
module: "commonjs",
target: "ES5"
}));
return tsResult.js.pipe(gulp.dest("./"));
});
// Browserify
var browserify = require("browserify");
var vinylSourceStream = require("vinyl-source-stream");
function makeBrowserify(source, destination, output) {
gulp.task(output + "-browserify", [ "typescript" ], function() {
var bundler = browserify(source);
bundler.transform("brfs");
function bundle() { return bundler.bundle().pipe(vinylSourceStream(output + ".js")).pipe(gulp.dest(destination)); };
return bundle();
});
tasks.push(output + "-browserify");
}
makeBrowserify("./data/index.js", "./public", "data");
makeBrowserify("./components/index.js", "./public", "components");
makeBrowserify("./componentEditors/index.js", "./public", "componentEditors");
makeBrowserify("./runtime/index.js", "./public", "runtime");
makeBrowserify("./api/index.js", "./public", "api");
// All
gulp.task("default", tasks);