-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntFile.js
153 lines (149 loc) · 4.65 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
module.exports = function(grunt){
grunt.initConfig({
express: {
prod: {
options: {
script: "server.js",
node_env: "production"
}
},
dev: {
options: {
script: "server.js",
node_env: "development"
}
}
},
less: {
dev: {
files: {
"library/css/app.css": ["library/less/*.less"]
}
}
},
cssmin: {
target: {
files: {
"public/css/app-dist.min.css": [
"library/bootstrap-3.3.6-dist/css/*.css",
"library/materialize/css/materialize.css",
"library/loaders.css-master/loaders.css",
"library/promise-buttons/angular-promise-buttons.css",
"library/speechkitt/speechkitt.css",
"library/css/*.css"]
}
}
},
concat: {
dist: {
src: [
"library/angular/angular.js",
"library/angular/angular-cookies.js",
"library/angular/angular-ui-router.js",
"library/angular/angular-resource.js",
"library/jquery/jquery-2.2.1.js",
"library/materialize/js/materialize.js",
"library/annyang/annyang.js",
"library/speechkitt/speechkitt.js",
"library/promise-buttons/angular-promise-buttons.js",
"library/socket.io/socket.io-client.js",
"library/ColorWheel/raphael.js",
"library/ColorWheel/colorwheel.js",
"library/ColorWheel/ng-colorwheel.js",
"library/scroll-glue/scrollglue.js",
"library/d3/d3.js",
"library/skycons/skycons.js",
"library/skycons/angular-skycons.js",
"library/app/app.js",
"library/app/app.constant.js",
"library/app/app.config.js",
"library/app/app.resource.js",
"library/app/app.service.js",
"library/app/app.controller.js",
"library/app/app.directive.js"],
dest: "library/js/app-dist.js",
}
},
uglify: {
prod: {
options: {
mangle: false,
},
files: {
"public/js/app-dist.min.js": ["library/js/app-dist.js"]
}
},
dev: {
options: {
mangle: false,
beautify: true
},
files: {
"public/js/app-dist.min.js": ["library/js/app-dist.js"]
}
}
},
watch: {
grunt: {
files: ["GruntFile.js"],
tasks: ["dev"],
options: {
spawn: false,
livereload: true
}
},
express: {
files: [
"japri_config.json",
"server.js",
"config/*.js",
"models/*.js",
"components/*.js",
"external_api/*.js"],
tasks: ["express:dev"],
options: {
spawn: false,
livereload: true
}
},
html: {
files: ["public/**/*.html"],
options: {
livereload: true
}
},
css: {
files: ["library/less/*.less"],
tasks: ["less", "cssmin"],
options: {
livereload: true
}
},
js: {
files: ["library/app/*.js"],
tasks: ["concat", "uglify:dev"],
options: {
livereload: true
}
}
}
});
grunt.loadNpmTasks("grunt-express-server");
grunt.loadNpmTasks("grunt-contrib-less");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.registerTask("dev", [
"less",
"cssmin",
"concat",
"uglify:dev",
"express:dev",
"watch"]);
grunt.registerTask("default", [
"less",
"cssmin",
"concat",
"uglify:prod"]);
};