-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
97 lines (93 loc) · 2.93 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
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: {
beautify: {
src: ['./lib/*.js', 'index.js', 'gruntFile.js', './test/**/*.js'],
options: {
config: '.jsbeautifyrc'
}
},
check: {
src: ['./lib/*.js', 'index.js', 'gruntFile.js', './test/**/*.js'],
options: {
mode: 'VERIFY_ONLY',
config: '.jsbeautifyrc'
}
}
},
browserify: {
dist: {
files: {
'dist/emcellent-toolkit.min.js': ['index.js']
}
},
options: {
browserifyOptions: {
standalone: 'mTools'
}
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */' + '\n'
},
my_target: {
files: {
'dist/emcellent-toolkit.min.js': ['dist/emcellent-toolkit.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']
}
}
});
};