This repository has been archived by the owner on Jan 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
/
Gruntfile.js
108 lines (101 loc) · 2.31 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
/*global module:true*/
(function () {
"use strict";
var pkg;
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: pkg = grunt.file.readJSON("bower.json"),
banner: "/*! <%= pkg.name %> - v<%= pkg.version %> - " +
"<%= grunt.template.today('yyyy-mm-dd') %>\n" +
" Licensed <%= pkg.license %> */\n",
// Task configuration.
uglify: {
options: {
banner: "<%= banner %>",
compress: {
global_defs: {
"RIDEBUG": false
},
dead_code: true
}
},
dev: {
options: {
beautify: true,
compress: {
global_defs: {
"RIDEBUG": false
},
dead_code: true
},
mangle: false
},
src: [ "respimage.dev.js" ],
dest: "respimage.js"
},
main: {
src: [ "respimage.js" ],
dest: "respimage.min.js"
},
plugins: {
files: [{
expand: true,
cwd: 'plugins/',
src: ['**/*.js', '!*.min.js', '!**/*.min.js'],
dest: 'plugins/',
ext: '.min.js',
extDot: 'last'
}]
}
},
qunit: {
options: {
timeout: 50000
},
files: [ "tests/*.html", "!tests/index-functional.html" ]
},
jshint: {
all: {
options: {
jshintrc: true
},
src: [ "respimage.dev.js", "plugins/*.js", "tests/*.js", "!Gruntfile.js", "!*.min.js", "!**/*.min.js" ] //, "Gruntfile.js", "tests/*.js"
}
},
watch: {
gruntfile: {
files: [ "Gruntfile.js", "respimage.dev.js", "plugins/*.js", "tests/*.js", "!*.min.js", "!**/*.min.js" ],
tasks: [ "default" ]
}
},
bytesize: {
all: {
src: [ "respimage.min.js" ]
}
},
maxFilesize: {
options: {
// Task-specific options go here.
},
minified: {
options: {
maxBytes: 9900
},
src: ["respimage.min.js"]
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-qunit");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks('grunt-bytesize');
grunt.loadNpmTasks('grunt-max-filesize');
// Default task.
grunt.registerTask("default", [ "test", "uglify", "bytesize", "maxFilesize" ]);
grunt.registerTask("test", [ "jshint", "qunit" ]);
};
})();