forked from yawetse/slimscroll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
107 lines (104 loc) · 2.64 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
/*
* slimscroll
* http://github.com/yawetse/slimscroll
*
* Copyright (c) 2014 Yaw Joseph Etse. All rights reserved.
*/
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jsbeautifier: {
files: ["<%= jshint.all %>"],
options: {
"indent_size": 2,
"indent_char": " ",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 10,
"brace_style": "collapse",
"keep_array_indentation": false,
"keep_function_indentation": false,
"space_before_conditional": true,
"eval_code": false,
"indent_case": false,
"unescape_strings": false,
"space_after_anon_function": true
}
},
simplemocha: {
options: {
globals: ['should'],
timeout: 3000,
ignoreLeaks: false,
ui: 'bdd',
reporter: 'spec'
},
all: {
src: 'test/**/*.js'
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'config/**/*.js',
'index.js',
'lib/**/*.js',
'routes/**/*.js',
'test/**/*.js',
'client/**/*.js',
]
},
jsdoc : {
dist : {
src: ['lib/*.js', 'test/*.js'],
options: {
destination: 'doc/html',
configure: 'jsdoc.json'
}
}
},
browserify: {
dist: {
files: {
'example/test/slimscroll-index.js': ['client/test/scripts/slimscroll-index.js'],
'example/test/slimscroll-events.js': ['client/test/scripts/slimscroll-events.js'],
// 'build/main.js': ['client/scripts/**/*.js', 'client/scripts/**/*.coffee'],
},
options: {
// transform: ['coffeeify']
}
}
},
watch: {
scripts: {
// files: '**/*.js',
files: [
'Gruntfile.js',
'config/**/*.js',
'index.js',
'lib/**/*.js',
'client/**/*.js',
'test/**/*.js',
],
tasks: ['lint','browserify',/*'doc',*/ 'test'],
options: {
interrupt: true
}
}
}
});
grunt.loadNpmTasks('grunt-simple-mocha');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.registerTask('default', ['jshint', 'simplemocha']);
grunt.registerTask('lint', 'jshint');
grunt.registerTask('doc','jsdoc');
grunt.registerTask('test', 'simplemocha');
};