forked from petruisfan/ionic-monthpicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·49 lines (40 loc) · 1.18 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var ngTemplates = require('gulp-ng-templates');
var htmlmin = require('gulp-htmlmin');
var src = [
'./src/ionic-monthpicker.module.js',
'./src/ionic-monthpicker.factory.js',
'./dist/templates.js'
];
var output = {
min: 'ionic-monthpicker.min.js',
unmin: 'ionic-monthpicker.js',
dist: './dist/'
};
gulp.task('buildmin', ['templates'], function() {
gulp.src(src)
.pipe(concat( output.min ))
.pipe(uglify())
.pipe(gulp.dest( output.dist ));
});
gulp.task('build', ['templates'], function() {
gulp.src(src)
.pipe(concat( output.unmin ))
.pipe(gulp.dest( output.dist ));
});
gulp.task('templates', function () {
return gulp.src('./src/monthpicker.html')
.pipe(htmlmin({collapseWhitespace: true}))
.pipe(ngTemplates({
standalone: false,
filename: 'templates.js',
module: 'ionic-monthpicker'
}))
.pipe(gulp.dest( output.dist ));
});
gulp.task('watch', function() {
gulp.watch('./src/*', ['build', 'buildmin']);
});
gulp.task('default', ['build','buildmin']);