forked from inmagik/ionic-modal-select
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
67 lines (51 loc) · 1.6 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var addsrc = require('gulp-add-src');
var replace = require('gulp-replace');
var jsifyTemplates = require('gulp-jsify-html-templates');
var uglify = require('gulp-uglify');
var order = require("gulp-order");
// Import at the top of the file
var karma = require('karma').Server;
/**
* Test task, run test once and exit
*/
gulp.task('test', function(done) {
var config = {
configFile: __dirname + '/tests/my.conf.js',
singleRun: true
};
var server = new karma(config)
server.start()
});
gulp.task('modal-select', function() {
return gulp.src( [
'./src/*.html',
])
.pipe(jsifyTemplates())
.pipe(replace("htmlTemplates", 'modalSelectTemplates'))
.pipe(concat('templates.js'))
.pipe(addsrc('src/banner.js'))
.pipe(addsrc('src/ionic-modal-select.js'))
.pipe(order(['src/banner.js', 'templates.js', 'src/ionic-modal-select.js']))
.pipe(concat('ionic-modal-select.js'))
.pipe(gulp.dest('./dist/'))
.pipe(uglify({mangle:false}))
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest('./dist/'))
});
gulp.task('css-modal-select', function() {
return gulp.src( './src/ionic-modal-select.css')
.pipe(gulp.dest('./dist/'))
.pipe(minifyCss({
keepSpecialComments: 0
}))
.pipe(rename({ extname: '.min.css' }))
.pipe(gulp.dest('./dist/'))
});
gulp.task('watch', function() {
gulp.watch(['./src/*.*'], ['modal-select']);
});
gulp.task('default', ['modal-select']);