forked from jbdemonte/angular-google-maps-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
49 lines (44 loc) · 1.19 KB
/
gulpfile.js
File metadata and controls
49 lines (44 loc) · 1.19 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
38
39
40
41
42
43
44
45
46
47
48
49
var gulp = require("gulp"),
concat = require("gulp-concat"),
uglify = require("gulp-uglify"),
rename = require("gulp-rename"),
clean = require("gulp-clean"),
mustache = require("gulp-mustache-plus"),
pjson = require("./package.json");
/**
* Remove temporaries files
*/
gulp.task("cleanTmp", function () {
return gulp.src("tmp", {read: false}).pipe(clean());
});
/**
* Build copyright
*/
gulp.task("copyright", function () {
return gulp.src("src/copyright.js")
.pipe(mustache(pjson, {extension: ".js"}))
.pipe(gulp.dest("./tmp"));
});
/**
* Build non minified version
*/
gulp.task("main", ["copyright"], function() {
return gulp.src(["tmp/copyright.js", "src/angular-google-maps-native.js"])
.pipe(concat("angular-google-maps-native.js"))
.pipe(gulp.dest("dist/"));
});
/**
* Build minified version
*/
gulp.task("uglify", ["main"], function() {
return gulp.src("dist/angular-google-maps-native.js")
.pipe(uglify({preserveComments: "some"}))
.pipe(rename("angular-google-maps-native.min.js"))
.pipe(gulp.dest("dist/"));
});
/**
* Full process to create distributable package
*/
gulp.task("dist", ["uglify"], function () {
gulp.start("cleanTmp");
});