-
Notifications
You must be signed in to change notification settings - Fork 69
/
gruntfile.js
executable file
·77 lines (72 loc) · 2.26 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
// --------------------------------
// PLEASE TRY RUNNING EVERYTHING THROUGH
// HERE, NO?
//
// 1.) TO TEST: grunt test-sanity
// 2.) TO TEST SPEED: grunt test-speed
// 3.) TO TEST AD-HOC / WIP: grunt test-wip
// 3.) TO BUILD EVERYTHING: grunt prod
//
// kthxbye!
//
module.exports = function(grunt){
grunt.initConfig({
"pkg": "package.json",
"jshint": {
"files": ["src/**/*.js","test/**/*.js","!src/solver.js","!test/misc/*.*","!test/test-wip/*.*"],
"options": {
"curly": true,
"eqeqeq": true,
"latedef": true,
"indent": 4,
"noempty": true,
"quotmark": "double",
"undef": true,
"globals": {"define": true, "window" :true}
}
},
"mochaTest": {
"test": {
"options": {
"reporter": "spec",
"quite": "false"
},
"src": ["test/solver.problems.js"]
}
},
"browserify": {
"dist": {
"files": {
"src/solver.js": ["./src/main.js"]
},
"options": {
"banner": "(function(){if (typeof exports === \"object\") {module.exports = require(\"./main\");}})();"
}
}
},
"uglify": {
"prod": {
"options": {
"sourceMap": true,
},
"files": {
"prod/solver.js": [
"src/solver.js"
]
}
}
}
});
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-mocha-test");
grunt.loadNpmTasks("grunt-browserify");
grunt.registerTask("default", ["jshint"]);
// The args can be picked up off of process.argv[2] in
// the file Mocha is hitting...
//
grunt.registerTask("test-sanity", ["jshint","mochaTest"]);
grunt.registerTask("test-speed", ["jshint","mochaTest"]);
grunt.registerTask("test-wip", ["jshint","mochaTest"]);
grunt.registerTask("prod", ["jshint","browserify", "uglify"]);
}