-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
68 lines (53 loc) · 1.73 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
67
68
var gulp = require("gulp");
var concat = require("gulp-concat");
var jshint = require("gulp-jshint");
var uglify = require("gulp-uglify");
var del = require("del");
var cssmin = require("gulp-cssmin");
var Server = require("karma").Server;
gulp.task("test", function (done) {
new Server({
configFile: __dirname + "/karma.conf.js",
singleRun: true
}, done).start();
});
gulp.task("lint", function () {
return gulp.src(["src/*.js", "!node_modules/**"])
.pipe(jshint())
.pipe(jshint.reporter("default"))
.pipe(jshint.reporter("fail"));
});
gulp.task("deploy",
["build", "remove-dist-dir", "copy-files"]
, function () { }
);
gulp.task("remove-dist-dir", function () {
del.sync("dist/**");
});
gulp.task("concat-js-files", function () {
return gulp.src(["./src/angular-barcode-febraban.module.js"
, "./src/angular-barcode-febraban.utils.js"
, "./src/angular-barcode-febraban.directive.js"])
.pipe(concat("angular-barcode-febraban.min.js"))
.pipe(uglify())
.pipe(gulp.dest("./dist/"));
});
gulp.task("minify-css", function () {
return gulp.src("./assets/css/barcode.css")
.pipe(cssmin())
.pipe(gulp.dest("./dist/css/"));
});
gulp.task("copy-barcode-font", function () {
return gulp.src("./assets/fonts/BarcodeInterleaved2of5.ttf")
.pipe(gulp.dest("./dist/fonts/"));
});
gulp.task("copy-demo", function () {
return gulp.src(["./demo/**", "!./demo/index_git.html"])
.pipe(gulp.dest("./dist/demo/"));
});
gulp.task("copy-files", ["concat-js-files", "minify-css", "copy-barcode-font", "copy-demo"], function () {
});
gulp.task("build", ["lint", "test"], function () {
});
gulp.task("default", ["deploy"], function () {
});