forked from markgoodyear/scrollup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
68 lines (67 loc) · 2.21 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
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*\n' +
'\n' +
' <%= pkg.name %> v<%= pkg.version %>\n' +
' Author: <%= pkg.authors[0].name %> - <%= pkg.authors[0].url %>\n' +
' <%= pkg.repositories[0].type %>: <%= pkg.repositories[0].url %>\n' +
'\n' +
' Copyright <%= pkg.year %> <%= pkg.authors[0].name %>.\n' +
' Licensed under the <%= pkg.licenses[0].name %> license\n' +
' http://www.opensource.org/licenses/mit-license.php\n' +
'\n' +
' Twitter: <%= pkg.authors[0].twitter %>\n' +
'\n' +
' */\n'
},
concat: {
dist: {
src: ["src/jquery.scrollUp.js"],
dest: "js/jquery.scrollUp.js"
},
options: {
banner: "<%= meta.banner %>"
}
},
uglify: {
options: {
// mangle: false,
banner: "<%= meta.banner %>"
},
'js/jquery.scrollUp.min.js': ['js/jquery.scrollUp.js']
},
jshint: {
all: [ 'src/jquery.scrollUp.js' ],
options: {
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"expr": true,
"immed": true,
"noarg": true,
"onevar": false,
"quotmark": "single",
"smarttabs": true,
"trailing": true,
"undef": true,
"unused": true,
"globals": {
"jQuery": true,
"window": true,
"document": true,
"scrollEvent": true,
"scrollDis": true
}
}
},
clean: ['js/jquery.scrollUp.min.js', 'js/jquery.scrollUp.js']
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.registerTask('default', [ 'clean', 'jshint', 'concat', 'uglify', ]);
};