forked from the-darc/angular-br-filters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
56 lines (49 loc) · 1.24 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
var gulp = require('gulp'),
path = require('path'),
jshintReporter = require('jshint-stylish'),
plugins = require('gulp-load-plugins')({
config: path.join(__dirname, 'package.json')
});
var path = {
src: {
files: 'src/**/*.js'
}
}
gulp.task('jshint', function(done) {
gulp.src(path.src.files)
.pipe(plugins.jshint('.jshintrc'))
.pipe(plugins.jshint.reporter(jshintReporter));
done();
});
gulp.task('build', function() {
var pkg = require('./package.json');
var header = ['/**',
' * <%= pkg.name %>',
' * <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @link <%= pkg.homepage %>',
' * @license <%= pkg.license %>',
' */',
'(function (angular) {',
' var global = {};',
'',
''].join('\n');
var footer = [
'',
'})(angular);',
''].join('\n');
gulp.src([
'bower_components/br-masks/releases/br-masks.js',
'src/filters.js'
])
.pipe(plugins.concat('angular-br-filters.js'))
.pipe(plugins.header(header, {pkg: pkg}))
.pipe(plugins.footer(footer))
.pipe(gulp.dest('./release/'))
.pipe(plugins.uglify())
.pipe(plugins.concat('angular-br-filters.min.js'))
.pipe(gulp.dest('./release/'));
});
gulp.task('default', ['jshint', 'build'], function() {
gulp.watch(path.src.files, ['jshint', 'build']);
});