This repository has been archived by the owner on May 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
/
Gruntfile.js
81 lines (75 loc) · 1.97 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
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
version: '<%= pkg.version %>',
banner: '/*!\n' +
' * Title: jQuery Super Labels Plugin - Give your forms a helping of awesome!\n' +
' * Author: Rémy Bach\n' +
' * Version: <%= pkg.version %>\n' +
' * License: http://remybach.mit-license.org\n' +
' * Url: http://github.com/remybach/jQuery.superLabels\n' +
' * Description:\n' +
' * This plugin allows you to display your form labels on top of your form fields, saving you space on your page.\n' +
' */\n'+
';'
},
jshint: {
files: ['jquery.superLabels.js'],
options: {
// Enforcing
curly: true,
immed: true,
indent: 4,
latedef: true,
newcap: true,
noarg: true,
noempty: true,
strict: true,
sub: true,
trailing: true,
undef: true,
unused: true,
// Relaxing
boss: true,
eqnull: true,
globalstrict: true,
iterator: true,
loopfunc: true,
smarttabs: true,
// Environments
browser: true,
jquery: true,
nonstandard: true,
white: false
}
},
checkBanner: {
filename: 'jquery.superLabels.js'
},
updateVersion: {
files: [ 'superLabels.jquery.json', 'bower.json' ]
},
minify: {
dest: 'jquery.superLabels.min.js',
filename: 'jquery.superLabels.js'
},
uglify: {
options: {
banner: '<%= meta.banner %>'
},
dist: {
files: {
'jquery.superLabels.min.js': ['<banner:meta.banner>', 'jquery.superLabels.min.js']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadTasks('tasks');
// Default task - Run JS Hint, check the version in the jquery.json file matches what's in packages.json, update the banner in the superlabels file, and minify.
grunt.registerTask('default', ["jshint", "updateVersion", "checkBanner", "minify"]);
};