-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathgulpfile.js
35 lines (31 loc) · 906 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
var gulp = require("gulp");
var uglify = require("gulp-uglify");
var rename = require("gulp-rename");
var karmaServer = require("karma").server;
// minify copy to dist/example dirs
gulp.task("build", function() {
gulp.src("src/**/*.js")
.pipe(gulp.dest("dist")) // copy unminified to dist too
.pipe(gulp.dest("example/www/js")) // copy unminified to example folders
.pipe(gulp.dest("example-storage/www/js"))
.pipe(uglify())
.pipe(rename(function(path) {
path.extname = ".min.js"
}))
.pipe(gulp.dest("dist"))
.pipe(gulp.dest("example/www/js"))
.pipe(gulp.dest("example-storage/www/js"));
});
// test single run
gulp.task("test", function() {
new karmaServer.start({
configFile: __dirname + "/karma.conf.js",
singleRun: true,
autoWatch : false,
});
});
gulp.task("tdd", function() {
new karmaServer.start({
configFile: __dirname + "/karma.conf.js"
})
});