-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
54 lines (47 loc) · 1.09 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 gclean = require('gulp-clean');
var ClosureCompiler = require('./bin/compiler.js');
var config = {
"config": {
"title": "Test example",
"what": "test"
},
"defines": {
"test": {
"test.MY_TEST_SENTENCE": "This is the end of the file."
}
},
"compiler": {
"closure": {
"baseFile": null
},
"calcdeps": {
"baseFile": null
},
"dependencies": [
[
"./test/js/**/*.js",
"!./test/js/**/*_test.js"
]
]
}
};
gulp.task("clean", function() {
return gulp.src(["./dist"])
.pipe(gclean());
});
gulp.task("test", ["clean"], function() {
return gulp.start(["test:closure", "test:calcdeps"]);
});
gulp.task("test:closure", function() {
var cc = new ClosureCompiler("closure", config);
return gulp.src(["test/test.html"])
.pipe(cc.compile())
.pipe(gulp.dest("./dist/closure"));
});
gulp.task("test:calcdeps", function() {
var cc = new ClosureCompiler("calcdeps", config);
return gulp.src(["test/test.html"])
.pipe(cc.compile())
.pipe(gulp.dest("./dist/calcdeps"));
});