-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgruntfile.js
103 lines (100 loc) · 3.34 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
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['jshint', 'mochaTest', 'jsbeautifier']);
grunt.registerTask('build:browser', ['jshint', 'mochaTest', 'browserify', 'uglify']);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: ['./lib/*.js', 'index.js', 'gruntFile.js', './test/**/*.js'],
options: {
browser: true,
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: false,
boss: true,
eqnull: true,
node: true,
expr: true,
globals: {
'xit': true,
'xdescribe': true,
'it': true,
'describe': true,
'before': true,
'after': true,
'done': true
}
}
},
jsbeautifier: {
files: ['./lib/*.js', 'index.js', 'gruntFile.js', 'package.json', './test/**/*.js', './test/**/*.json'],
options: {
js: {
"indent_size": 4,
"indent_char": " ",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 2,
"jslint_happy": true,
"brace_style": "collapse",
"keep_array_indentation": false,
"keep_function_indentation": false,
"space_before_conditional": true,
"break_chained_methods": false,
"eval_code": false,
"unescape_strings": false,
"wrap_line_length": 0
}
}
},
browserify: {
dist: {
files: {
'dist/emcellent.min.js': ['index.js']
},
options: {
browserifyOptions: {
standalone: 'emcellent'
}
},
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */' + '\n'
},
my_target: {
files: {
'dist/emcellent.min.js': ['dist/emcellent.min.js']
}
}
},
watch: {
all: {
files: ['./lib/*.js', 'index.js', 'gruntFile.js', './test/**/*.js'],
tasks: ['default']
}
},
mochaTest: {
test: {
options: {
reporter: 'spec',
timeout: '10000'
},
src: ['test/unit/*.js', 'test/e2e/*.js']
}
}
});
};