forked from mhartington/ion-md-input
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
73 lines (65 loc) · 1.81 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
69
70
71
72
73
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var ngAnnotate = require('gulp-ng-annotate');
var uglify = require('gulp-uglify');
var tag_version = require('gulp-tag-version');
var git = require('gulp-git');
var bump = require('gulp-bump');
var filter = require('gulp-filter');
gulp.task('default', ['sass', 'js']);
gulp.task('build', ['sass', 'js']);
gulp.task('sass', function(done) {
gulp.src('./ion-md-input.scss')
.pipe(sass())
.pipe(gulp.dest('./css/'))
.pipe(gulp.dest('./demo/www/css/'))
.pipe(minifyCss({
keepSpecialComments: 0
}))
.pipe(rename({
extname: '.min.css'
}))
.pipe(gulp.dest('./css/'))
.pipe(gulp.dest('./demo/www/css/'))
.on('end', done);
});
gulp.task('js', function() {
return gulp.src('./ion-md-input.js')
.pipe(ngAnnotate())
.pipe(gulp.dest('./js'))
.pipe(gulp.dest('./demo/www/js'))
.pipe(uglify())
.pipe(rename({
extname: '.min.js'
}))
.pipe(gulp.dest('./js'))
.pipe(gulp.dest('./demo/www/js'));
});
function inc(importance) {
// get all the files to bump version in
return gulp.src(['./package.json', './bower.json'])
// bump the version number in those files
.pipe(bump({
type: importance
}))
// save it back to filesystem
.pipe(gulp.dest('./'))
// commit the changed version number
.pipe(git.commit('bumps package version'))
// read only one file to get the version number
.pipe(filter('package.json'))
// **tag it in the repository**
.pipe(tag_version());
}
gulp.task('patch', function() {
return inc('patch');
});
gulp.task('minor', function() {
return inc('minor');
});
gulp.task('major', function() {
return inc('major');
});