forked from ryanve/cmon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntFile.js
45 lines (45 loc) · 1.59 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
beforeconcat: ['src/<%= pkg.name %>.js', 'test/tests.js', 'GruntFile.js'],
afterconcat: ['<%= pkg.name %>.js'],
options: {
expr:true, sub:true, supernew:true, debug:true, node:true,
boss:true, devel:true, evil:true, laxcomma:true, eqnull:true,
undef:true, unused:true, browser:true, jquery:true, maxerr:10
}
},
concat: {
options: {
banner: [
'/*!',
' * <%= pkg.name %> <%= pkg.version %>+<%= grunt.template.today("UTC:yyyymmddHHMM") %>',
' * <%= pkg.homepage %>',
' * MIT License 2013 <%= pkg.author %>',
' */\n\n'
].join('\n')
},
build: {
files: {
'<%= pkg.name %>.js': ['src/<%= pkg.name %>.js']
}
}
},
uglify: {
options: {
report: 'gzip',
preserveComments: 'some'
},
build: {
files: {
'<%= pkg.name %>.min.js': ['<%= pkg.name %>.js']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['jshint:beforeconcat', 'concat', 'jshint:afterconcat', 'uglify']);
};