This repository has been archived by the owner on Nov 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathGruntfile.js
104 lines (102 loc) · 2.56 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
module.exports = function (grunt) {
grunt.initConfig({
pkg : grunt.file.readJSON("package.json"),
concat : {
options : {
banner : "/**\n" +
" * <%= pkg.name %>\n" +
" *\n" +
" * @author <%= pkg.author.name %> <<%= pkg.author.email %>>\n" +
" * @copyright <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>\n" +
" * @license <%= pkg.licenses[0].type %> <<%= pkg.licenses[0].url %>>\n" +
" * @link <%= pkg.homepage %>\n" +
" * @module <%= pkg.name %>\n" +
" * @version <%= pkg.version %>\n" +
" */\n"
},
dist : {
src : [
"src/intro.js",
"src/regex.js",
"src/array.js",
"src/cache.js",
"src/channel.js",
"src/client.js",
"src/cookie.js",
"src/data.js",
"src/datalist.js",
"src/deferred.js",
"src/element.js",
"src/filter.js",
"src/grid.js",
"src/json.js",
"src/label.js",
"src/lru.js",
"src/math.js",
"src/message.js",
"src/mouse.js",
"src/number.js",
"src/observer.js",
"src/promise.js",
"src/prototypes.js",
"src/route.js",
"src/state.js",
"src/string.js",
"src/utility.js",
"src/validate.js",
"src/xhr.js",
"src/xml.js",
"src/bootstrap.js",
"src/interface.js",
"src/outro.js"
],
dest : "lib/<%= pkg.name %>.js"
}
},
exec : {
closure : {
cmd : "cd lib\nclosure-compiler --js <%= pkg.name %>.js --js_output_file <%= pkg.name %>.min.js --create_source_map ./<%= pkg.name %>.map"
},
sourcemap : {
cmd : "echo //@ sourceMappingURL=<%= pkg.name %>.map >> lib/<%= pkg.name %>.min.js"
}
},
jshint : {
options : {
jshintrc : ".jshintrc"
},
src : "lib/<%= pkg.name %>.js"
},
nodeunit : {
all : ["test/*.js"]
},
sed : {
"version" : {
pattern : "{{VERSION}}",
replacement : "<%= pkg.version %>",
path : ["<%= concat.dist.dest %>"]
}
},
watch : {
js : {
files : "<%= concat.dist.src %>",
tasks : "default"
},
pkg: {
files : "package.json",
tasks : "default"
}
}
});
// tasks
grunt.loadNpmTasks("grunt-sed");
grunt.loadNpmTasks("grunt-exec");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-nodeunit");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks('grunt-contrib-watch');
// aliases
grunt.registerTask("test", ["nodeunit", "jshint"]);
grunt.registerTask("build", ["concat", "sed", "exec"]);
grunt.registerTask("default", ["build", "test"]);
};