This repository has been archived by the owner on Feb 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Gruntfile.js
65 lines (58 loc) · 2.05 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
module.exports = function(grunt) {
var pack = require("./package.json");
grunt.initConfig({
jshint: {
files: ['ring.js', 'test.js'],
options: {
es3: true, // ie 7 compatibility
eqeqeq: true, // no == or !=
immed: true, // forces () around directly called functions
forin: true, // makes it harder to use for in
latedef: "nofunc", // makes it impossible to use a variable before it is declared
newcap: true, // force capitalized constructors
strict: true, // enforce strict mode
trailing: true, // trailing whitespaces are ugly
maxlen: 120, // maximum characters per line
camelcase: true, // force camelCase
},
},
/*mocha: {
browser: {
src: ['test.html'],
options: {
log: true,
reporter: "Nyan",
run: true,
},
}
},*/
mochaTest: {
node: {
src: ['test.js'],
options: {
ui: "qunit",
}
}
},
compress: {
main: {
options: {
archive: pack.name + "-" + pack.version + ".zip",
},
files: [
{src: 'ring.js', dest: '.'},
{expand: true, flatten: true, src: 'bower_components/lodash/lodash.js', dest: '.'},
{src: 'README', dest: '.'},
{src: 'package.json', dest: '.'},
],
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.registerTask('test', ['jshint', /*"mocha",*/ "mochaTest"]);
grunt.registerTask('dist', ['compress']);
grunt.registerTask('default', ['test']);
};