This repository has been archived by the owner on Jun 3, 2018. It is now read-only.
/
Gruntfile.js
113 lines (102 loc) · 3.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
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
104
105
106
107
108
109
110
111
112
113
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
copyright: "(c) 2011-<%= grunt.template.today('yyyy') %>",
clean: {
files: ["dist"]
},
concat: {
dist: {
options: {
banner: "/*!\n" +
" * <%= pkg.title || pkg.name %> v<%= pkg.version %>\n" +
" * <%= pkg.homepage %>\n" +
" *\n" +
" * Copyright <%= copyright %> <%= pkg.author.name %>.\n" +
" * Released under the <%= pkg.license %> License.\n" +
" */\n",
stripBanners: true
},
src: ["src/jquery.timeout.js"],
dest: "dist/jquery.timeout.js"
},
plugin: {
options: {
process: true
},
src: ["src/plugin.json"],
dest: "timeout.jquery.json"
},
bower: {
options: {
process: true
},
src: ["src/bower.json"],
dest: "bower.json"
}
},
uglify: {
options: {
banner: "/*! <%= pkg.title || pkg.name %> v<%= pkg.version %> | " +
"<%= copyright %> <%= pkg.author.name %> | " +
"<%= pkg.license %> License */\n"
},
dist: {
src: ["<%= concat.dist.dest %>"],
dest: "dist/jquery.timeout.min.js"
}
},
jshint: {
options: {
jshintrc: true
},
grunt: {
files: {
src: ["Gruntfile.js"]
}
},
src: {
files: {
src: ["src/**/*.js"]
}
},
dist: {
files: {
src: ["dist/jquery.timeout.js"]
}
},
tests: {
files: {
src: ["tests/**/*.js"]
}
}
},
qunit: {
files: ["tests/**/*.html"]
},
watch: {
gruntfile: {
files: "<%= jshint.gruntfile.src %>",
tasks: ["jshint:grunt"]
},
src: {
files: "<%= jshint.src.src %>",
tasks: ["jshint:src"]
},
tests: {
files: "<%= jshint.tests.src %>",
tasks: ["jshint:tests"]
}
}
});
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-qunit");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.registerTask("dist", ["concat", "uglify"]);
grunt.registerTask("lint", ["jshint:grunt", "jshint:src", "jshint:tests"]);
grunt.registerTask("test", ["qunit"]);
grunt.registerTask("default", ["dist", "jshint:dist"]);
};