forked from muaz-khan/RecordRTC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
193 lines (184 loc) · 6.62 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
'use strict';
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt, {
pattern: 'grunt-*',
config: 'package.json',
scope: 'devDependencies'
});
var versionNumber = grunt.file.readJSON('package.json').version;
var banner = '\'use strict\';\n\n';
banner += '// Last time updated: <%= grunt.template.today("UTC:yyyy-mm-dd h:MM:ss TT Z") %>\n\n';
banner += '// ________________\n';
banner += '// RecordRTC v' + versionNumber + '\n\n';
banner += '// Open-Sourced: https://github.com/muaz-khan/RecordRTC\n\n';
banner += '// --------------------------------------------------\n';
banner += '// Muaz Khan - www.MuazKhan.com\n';
banner += '// MIT License - www.WebRTC-Experiment.com/licence\n';
banner += '// --------------------------------------------------\n\n';
// configure project
grunt.initConfig({
// make node configurations available
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
stripBanners: true,
separator: '\n',
banner: banner
},
dist: {
src: [
'dev/RecordRTC.js',
'dev/RecordRTC-Configuration.js',
'dev/GetRecorderType.js',
'dev/MRecordRTC.js',
'dev/amd.js',
'dev/Cross-Browser-Declarations.js',
'dev/Storage.js',
'dev/isMediaRecorderCompatible.js',
'dev/MediaStreamRecorder.js',
'dev/StereoAudioRecorder.js',
'dev/CanvasRecorder.js',
'dev/WhammyRecorder.js',
'dev/Whammy.js',
'dev/DiskStorage.js',
'dev/GifRecorder.js',
'dev/MultiStreamRecorder.js',
'dev/RecordRTC.promises.js'
],
dest: 'RecordRTC.js',
},
},
jshint: {
options: {
globals: {
webkitIndexedDB: true,
mozIndexedDB: true,
OIndexedDB: true,
msIndexedDB: true,
indexedDB: true,
FileReaderSync: true,
postMessage: true,
Whammy: true,
WhammyRecorder: true,
MediaStreamRecorder: true,
StereoAudioRecorder: true,
RecordRTC: true,
MRecordRTC: true,
URL: true,
webkitURL: true,
DiskStorage: true,
requestAnimationFrame: true,
cancelAnimationFrame: true,
webkitRequestAnimationFrame: true,
webkitCancelAnimationFrame: true,
mozRequestAnimationFrame: true,
mozCancelAnimationFrame: true,
msRequestAnimationFrame: true,
msCancelAnimationFrame: true,
MediaStream: true,
webkitMediaStream: true,
html2canvas: true,
GifRecorder: true,
GIFEncoder: true,
MediaRecorder: true,
webkitAudioContext: true,
mozAudioContext: true,
AudioContext: true,
Promise: true,
JSON: true,
typeof: true,
define: true
},
browser: true,
browserify: true,
node: true,
camelcase: true,
curly: true,
devel: true,
eqeqeq: true,
forin: false,
globalstrict: true,
quotmark: true,
undef: true,
//es5: true,
funcscope: true,
shadow: true, //----should be false?
typed: true,
worker: true
},
files: ['RecordRTC.js']
},
uglify: {
options: {
mangle: false,
banner: banner
},
my_target: {
files: {
'RecordRTC.min.js': ['RecordRTC.js']
}
}
},
jsbeautifier: {
files: [
// 'RecordRTC.js',
'dev/*.js',
'Gruntfile.js'
],
options: {
js: {
braceStyle: "collapse",
breakChainedMethods: false,
e4x: false,
evalCode: false,
indentChar: " ",
indentLevel: 0,
indentSize: 4,
indentWithTabs: false,
jslintHappy: false,
keepArrayIndentation: false,
keepFunctionIndentation: false,
maxPreserveNewlines: 10,
preserveNewlines: true,
spaceBeforeConditional: true,
spaceInParen: false,
unescapeStrings: false,
wrapLineLength: 0
},
html: {
braceStyle: "collapse",
indentChar: " ",
indentScripts: "keep",
indentSize: 4,
maxPreserveNewlines: 10,
preserveNewlines: true,
unformatted: ["a", "sub", "sup", "b", "i", "u"],
wrapLineLength: 0
},
css: {
indentChar: " ",
indentSize: 4
}
}
},
bump: {
options: {
files: ['package.json', 'bower.json'],
updateConfigs: [],
commit: true,
commitMessage: 'v%VERSION%',
commitFiles: ['package.json', 'bower.json'],
createTag: true,
tagName: '%VERSION%',
tagMessage: '%VERSION%',
push: false,
pushTo: 'upstream',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d'
}
}
});
// enable plugins
// set default tasks to run when grunt is called without parameters
// http://gruntjs.com/api/grunt.task
grunt.registerTask('default', ['concat', 'jsbeautifier', 'jshint', 'uglify']);
};