-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
94 lines (82 loc) · 2.5 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
/*jslint node: true */
"use strict";
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
uglify: {
dist: {
files: {
"dist/webprime.min.js": [ "dist/webprime.min.js" ]
},
options: {
mangle: false
}
}
},
clean: {
temp: {
src: [ "tmp" ]
},
dist: {
src: [ "dist/*.js", "dist/*.css" ]
}
},
concat: {
dist: {
src: ["3rdparty/jquery/dist/jquery.min.js", "3rdparty/jpak/dist/jpak.js", "3rdparty/requestAnimationFrame/app/requestAnimationFrame.js", "lib/*.js" ],
dest: "dist/webprime.min.js"
}
},
jshint: {
all: [ "Gruntfile.js", "lib/*.js" ]
},
connect: {
server: {
options: {
hostname: "localhost",
port: 8082
}
}
},
watch: {
dev: {
files: [ "Gruntfile.js", "lib/*.js", "3rdparty/jpak/dist/jpak.js", "3rdparty/requestAnimationFrame/app/requestAnimationFrame.js", "3rdparty/jquery/dist/jquery.min.js" ],
tasks: [ "jshint", "concat:dist", "clean:temp" ],
options: {
atBegin: true
}
},
min: {
files: [ "Gruntfile.js", "lib/*.js", "3rdparty/jpak/dist/jpak.js", "3rdparty/requestAnimationFrame/app/requestAnimationFrame.js", "3rdparty/jquery/dist/jquery.min.js"],
tasks: [ "jshint", "concat:dist", "clean:temp", "uglify:dist" ],
options: {
atBegin: true
}
}
},
compress: {
dist: {
options: {
archive: "dist/<%= pkg.name %>-<%= pkg.version %>.zip"
},
files: [{
src: [ "dist/*.js", "dist/*.css" ]
}]
}
},
});
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-less");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-contrib-compress");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.registerTask("dev", [ "clean:dist", "connect:server", "watch:dev" ]);
grunt.registerTask("test", [ "clean:dist", "jshint" ]);
grunt.registerTask("junit", [ "clean:dist", "jshint" ] );
grunt.registerTask("minified", [ "clean:dist", "connect:server", "watch:min" ]);
grunt.registerTask("package", [ "clean:dist", "jshint", "concat:dist",
"uglify:dist", "less:dist", "clean:temp", "compress:dist" ]);
};