forked from oliversalzburg/angular-timepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
61 lines (55 loc) · 1.66 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
49
50
51
52
53
54
55
56
57
58
59
60
61
module.exports = function (grunt) {
var taskConfig = {
pkg: grunt.file.readJSON('package.json'),
karma: {
options: {
configFile: 'karma.conf.js'
},
unit: {
runnerPort: 9101,
background: true
},
single: {
singleRun: true
}
},
uglify: {
raw: {
options: {
beautify: true,
sourceMap: false,
mangle: false,
compress: false,
preserveComments: 'some',
banner: ['/*!', ' * <%= pkg.name %> <%= pkg.version %>', ' * <%= pkg.homepage %>', ' * Copyright <%= grunt.template.today("yyyy") %>, <%= pkg.author.name %>', ' * Contributors: <%= pkg.contributors %>', ' * Licensed under: <%= pkg.license %>\n */\n\n'].join('\n')
},
files: {
'dist/angular-timepicker.js': ['src/angular-timepicker.js']
}
},
prod: {
options: {
sourceMap: true,
mangle: true,
compress: {
drop_console: true
},
preserveComments: false,
banner: '/*! <%= pkg.name %> <%= pkg.version %> | ' +
'(c) <%= grunt.template.today("yyyy") %>, <%= pkg.author.name %> | ' +
'<%= pkg.license %> */'
},
files: {
'dist/angular-timepicker.min.js': ['dist/angular-timepicker.js']
}
}
},
clean: ['dist']
};
grunt.initConfig(taskConfig);
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('default', ['karma:single']);
grunt.registerTask('build', [ 'karma:single', 'clean', 'uglify']);
};