-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
41 lines (37 loc) · 1.21 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
var gulp = require('gulp'),
concat = require('gulp-concat'),
rename = require("gulp-rename"),
uglify = require("gulp-uglify"),
pkg = require("./package.json"),
clean = require("gulp-clean"),
header = require('gulp-header');
gulp.task('clean', function(){
return gulp.src('dist', {read: false})
.pipe(clean());
});
var banner = ['/*!',
' * <%= pkg.name %> v<%= pkg.version %> - <%= pkg.description %>',
' * Copyright Maarten Schroeven and other contributors',
' * <%= pkg.homepage %>',
' * Released under the MIT license',
' */',
''].join('\n');
gulp.task('build', function () {
return gulp.src([
'src/angular-mew.module.js',
'src/angular-mew.constants.js',
'src/hawk-configuration.service.js',
'src/hawk-interceptor.service.js',
'src/angular-mew.config.js',
'src/angular-mew.run.js'
])
.pipe(concat(pkg.name + '.js'))
.pipe(header(banner, {pkg: pkg}))
.pipe(gulp.dest('dist'))
.pipe(uglify({preserveComments: 'license'}))
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['clean', 'build']);