forked from rajeshwarpatlolla/ionic-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 8
/
gulpfile.js
executable file
·73 lines (61 loc) · 1.76 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 del = require('del');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var ngHtml2Js = require("gulp-ng-html2js");
var minifyHtml = require("gulp-minify-html");
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var css2js = require("gulp-css2js");
var path = {
src: ['./src/*.*']
};
gulp.task('html2js', function () {
return gulp.src(['./src/*.html'])
.pipe(minifyHtml())
.pipe(ngHtml2Js({
moduleName: "ionic-multi-date-picker.templates"
}))
.pipe(concat("templates.js"))
//.pipe(uglify())
.pipe(gulp.dest("./dist"));
});
gulp.task('scss', function () {
gulp.src('./src/ionic-multi-date-picker.scss')
.pipe(sass())
.on('error', sass.logError)
.pipe(gulp.dest('./src/'));
/*.pipe(minifyCss({
keepSpecialComments: 0
}))
.pipe(rename({ extname: '.min.css' }))
.pipe(gulp.dest('./www/css/'))
.on('end', done);*/
});
gulp.task('css2js', function () {
return gulp.src('./src/ionic-multi-date-picker.scss')
.pipe(sass())
.pipe(minifyCss({
keepSpecialComments: 0
}))
.pipe(css2js())
//.pipe(uglify())
.pipe(gulp.dest("./dist/"));
});
gulp.task('make-bundle', ['del', 'html2js', 'css2js'], function () {
return gulp.src(['dist/*.js', './src/*.js'])
.pipe(concat('ionic-multi-date-picker.bundle.min.js'))
//.pipe(uglify())
.pipe(gulp.dest('dist/'));
});
gulp.task('del-temp-files', ['make-bundle'], function () {
return del(['dist/templates.js', 'dist/ionic-multi-date-picker.styles.js']);
});
gulp.task('del', function () {
return del(['dist/*']);
});
gulp.task('build', ['del-temp-files']);
gulp.task('watch', function () {
gulp.watch(path.src, ['build']);
});
gulp.task('default', ['watch']);