-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
105 lines (88 loc) · 2.43 KB
/
Gruntfile.js
File metadata and controls
105 lines (88 loc) · 2.43 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/**
* @file Gruntfile.js
* @version 0.0.1
*
* @copyright 2014 CoNWeT Lab., Universidad Politécnica de Madrid
* @license Apache v2 (https://github.com/Wirecloud/room-manager-widget/blob/master/LICENSE)
*/
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: ' * @version <%= pkg.version %>\n' +
' * \n' +
' * @copyright 2014 <%= pkg.author %>\n' +
' * @license <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
' */',
concat: {
options: {
stripBanners: true
},
dist: {
options: {
banner: '/*!\n * @file <%= pkg.name %>.js\n<%= banner %>\n\n'
},
src: [
'widget/js/kws-rpc-builder.js',
'widget/js/kws-utils.js',
'widget/js/room-manager.js'
],
dest: 'widget/dist/js/<%= pkg.name %>.js'
}
},
uglify: {
options: {
preserveComments: false
},
dist: {
options: {
banner: '/*!\n * @file <%= pkg.name %>.min.js\n<%= banner %>\n'
},
src: '<%= concat.dist.dest %>',
dest: 'widget/dist/js/<%= pkg.name %>.min.js'
}
},
less: {
dist: {
options: {
banner: '/*!\n * @file <%= pkg.name %>.css\n<%= banner %>\n\n'
},
src: [
'widget/less/widget.less'
],
dest: 'widget/dist/css/<%= pkg.name %>.css'
}
},
cssmin: {
options: {
keepSpecialComments: 0
},
dist: {
options: {
banner: '/*!\n * @file <%= pkg.name %>.min.css\n<%= banner %>\n'
},
src: '<%= less.dist.dest %>',
dest: 'widget/dist/css/<%= pkg.name %>.min.css'
}
},
compress: {
widget: {
options: {
archive: '<%= pkg.name %>.zip'
},
files: [
{expand: true, src: ['**/*'], dest: './', cwd: 'widget'}
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.registerTask('js', ['concat:dist', 'uglify:dist']);
grunt.registerTask('css', ['less:dist', 'cssmin:dist']);
grunt.registerTask('zip', ['compress:widget']);
grunt.registerTask('default', ['js', 'css', 'zip']);
};