forked from wyntau/angular-ios-alertview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
57 lines (51 loc) · 1.38 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
var pkg = require('./package.json')
, gulp = require('gulp')
, uglify = require('gulp-uglify')
, rename = require('gulp-rename')
, minifyCSS = require('gulp-minify-css')
, header = require('gulp-header')
, autoprefixer = require('gulp-autoprefixer')
, bannerData = {
pkg: pkg,
date: new Date()
}
, bannerTemplate = [
'/*!',
' * <%= pkg.name %> <%= pkg.version %>',
' * <%= pkg.description %>',
' * License: <%= pkg.license %>',
' * Author: <%= pkg.author %>',
' * build: <%= date %>',
' **/\n'
].join('\n')
gulp.task('js', function(){
return gulp.src('src/angular-ios-alertview.js')
.pipe(header(bannerTemplate, bannerData))
.pipe(gulp.dest('.'))
.pipe(uglify({
mangle: {
except: ['angular']
},
preserveComments: 'license'
}))
.pipe(rename('angular-ios-alertview.min.js'))
.pipe(gulp.dest('.'));
});
gulp.task('css', function(){
return gulp.src('src/angular-ios-alertview.css')
.pipe(autoprefixer({
browsers: ['> 1%']
}))
.pipe(header(bannerTemplate, bannerData))
.pipe(gulp.dest('.'))
.pipe(minifyCSS({
advanced: false,
keepSpecialComments: 1
}))
.pipe(rename('angular-ios-alertview.min.css'))
.pipe(gulp.dest('.'));
});
gulp.task('dev', ['js', 'css'], function(){
gulp.watch('src/**/*', ['js', 'css']);
});
gulp.task('default', ['js', 'css']);