-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
48 lines (42 loc) · 1.13 KB
/
Gruntfile.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
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['dist/<%= pkg.name %>.js']
}
}
},
concat: {
dist: {
src: ['src/<%= pkg.name %>.js', 'src/directive.js', 'src/service.js'],
dest: 'dist/<%= pkg.name %>.js',
options: {
banner: grunt.file.read('src/intro').toString(),
footer: grunt.file.read('src/outro').toString()
}
}
},
usebanner: {
dist: {
options: {
banner: '/*\n' +
'\t<%= pkg.name %> v<%= pkg.version %>\n' +
'\t<%= pkg.homepage %>\n\n' +
'\tCopyright (c) <%= grunt.template.today(\'yyyy\') %> <%= pkg.author.name %> <<%= pkg.author.email %>>\n\n' +
'\tLicense: MIT (<%= pkg.homepage %>/blob/master/LICENSE)\n*/\n\n'
},
files: {
src: ['dist/**/*.js']
}
}
}
});
grunt.registerTask('build', [
'concat:dist',
'uglify:dist',
'usebanner:dist'
]);
};