-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
41 lines (37 loc) · 1.08 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'),
path = require('path'),
plugins = require('gulp-load-plugins')({
config: path.join(__dirname, 'package.json')
});
gulp.task('build', function() {
var pkg = require('./bower.json');
var header = ['/**',
' * <%= pkg.name %>',
' * <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @link <%= pkg.homepage %>',
' * @license <%= pkg.license %>',
' */',
'(function (angular) {',
' var window = {};',
'',
''].join('\n');
var footer = [
'',
'})(angular);',
''].join('\n');
gulp.src([
'bower_components/mousetrap/mousetrap.js',
'src/before-plugins.js',
'bower_components/mousetrap/plugins/pause/mousetrap-pause.js',
'bower_components/mousetrap/plugins/bind-dictionary/mousetrap-bind-dictionary.js',
'src/angular-mousetrap-service.js'
])
.pipe(plugins.concat('angular-mousetrap-service.js'))
.pipe(plugins.header(header, {pkg: pkg}))
.pipe(plugins.footer(footer))
.pipe(gulp.dest('./release/'))
.pipe(plugins.uglify())
.pipe(plugins.concat('angular-mousetrap-service.min.js'))
.pipe(gulp.dest('./release/'));
});