-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgulpfile.js
More file actions
executable file
·42 lines (36 loc) · 1.01 KB
/
gulpfile.js
File metadata and controls
executable file
·42 lines (36 loc) · 1.01 KB
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
var gulp = require('gulp');
var path = require('path');
var karma = require('karma').server;
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var wrapper = require('gulp-wrapper');
var sourcemaps = require('gulp-sourcemaps');
var ngAnnotate = require('gulp-ng-annotate');
var paths = {
scripts: ['src/**/*.js']
};
gulp.task('test', function (done) {
karma.start({
configFile: path.join(__dirname, 'karma.conf.js'),
singleRun: true
}, done);
});
gulp.task('build', function () {
gulp.src(paths.scripts)
.pipe(ngAnnotate())
.pipe(concat('ng-currency-mask.js'))
.pipe(gulp.dest('dist'));
return gulp.src(paths.scripts)
.pipe(ngAnnotate())
.pipe(concat('ng-currency-mask.min.js'))
.pipe(wrapper({
header: '(function (window, undefined, angular) {',
footer: '}(window, undefined, angular));'
}))
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('watch', function () {
gulp.watch(paths.scripts, ['build']);
});
gulp.task('default', ['watch', 'build']);