forked from bktz/Laravel-4-AngularJS-Starter-Site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
221 lines (207 loc) · 6.4 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
//Directories
bowerDir: 'public/vendor',
assetsDir: 'public/assets',
appDir: 'public/app/js',
clean: ['<%= assetsDir %>/tmp'],
copy: {
angular: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/angular', src: ['angular.js'], dest: '<%= assetsDir %>/js' }
]
},
angularCookies: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/angular-cookies', src: ['angular-cookies.js'], dest: '<%= assetsDir %>/js' }
]
},
bootstrap: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/bootstrap/less', src: ['bootstrap.less'], dest: '<%= assetsDir %>/tmp/bootstrap' },
{ expand: true, cwd: '<%= bowerDir %>/bootstrap/dist/js', src: ['bootstrap.js'], dest: '<%= assetsDir %>/js' },
{ expand: true, cwd: '<%= bowerDir %>/bootstrap/dist/fonts', src: ['*'], dest: '<%= assetsDir %>/fonts' }
]
},
fontawesome: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/font-awesome/less', src: ['font-awesome.less'], dest: '<%= assetsDir %>/tmp/font-awesome' },
{ expand: true, cwd: '<%= bowerDir %>/font-awesome/font', src: ['*'], dest: '<%= assetsDir %>/fonts' }
]
},
iehtml5: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ie-html5/dist', src: ['*'], dest: '<%= assetsDir %>/js' },
]
},
iejson: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ie-json/lib', src: ['json3.js'], dest: '<%= assetsDir %>/js' }
]
},
lodash: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/lodash/dist', src: ['lodash.js'], dest: '<%= assetsDir %>/js' }
]
},
ng: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ng', src: ['angular.js'], dest: '<%= assetsDir %>/js' }
]
},
ngcaptcha: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ng-captcha/release', src: ['angular-recaptcha.js'], dest: '<%= assetsDir %>/js' }
]
},
ngcookies: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ng-cookies', src: ['angular-cookies.js'], dest: '<%= assetsDir %>/js' }
]
},
ngi18n: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ng-i18n', src: ['angular-locale_en.js'], dest: '<%= assetsDir %>/js' }
]
},
ngresource: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ng-resource', src: ['angular-resource.js'], dest: '<%= assetsDir %>/js' }
]
},
ngrest: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ng-rest/dist', src: ['restangular.js'], dest: '<%= assetsDir %>/js' }
]
},
ngrouter: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ng-router', src: ['angular-route.js'], dest: '<%= assetsDir %>/js' }
]
},
ngsanitize: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ng-sanitize', src: ['angular-sanitize.js'], dest: '<%= assetsDir %>/js' }
]
},
ngstorage: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ng-storage/src', src: ['angularLocalStorage.js'], dest: '<%= assetsDir %>/js' }
]
},
ngtranslate: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ng-translate', src: ['angular-translate.js'], dest: '<%= assetsDir %>/js' }
]
},
ngupload: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ng-upload/dist', src: ['angular-file-upload.js'], dest: '<%= assetsDir %>/js' }
]
},
uibootstrap: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ui-bootstrap', src: ['ui-bootstrap-tpls.js'], dest: '<%= assetsDir %>/js' }
]
},
uirouter: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ui-router/release', src: ['angular-ui-router.js'], dest: '<%= assetsDir %>/js' }
]
},
ngtable: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/ng-table', src: ['ng-table.js'], dest: '<%= assetsDir %>/js' }
]
},
jquery: {
files: [
{ expand: true, cwd: '<%= bowerDir %>/jquery/dist', src: ['jquery.js'], dest: '<%= assetsDir %>/js' }
]
}
},
less: {
bootstrap: {
options: {
ieCompat: true,
yuicompress: true,
paths: ['<%= assetsDir %>/less/bootstrap', '<%= assetsDir %>/tmp/bootstrap', '<%= bowerDir %>/bootstrap/less']
},
files: {
'<%= assetsDir %>/tmp/bootstrap.css': '<%= assetsDir %>/less/bootstrap/main.less'
}
},
fontawesome: {
options: {
ieCompat: true,
yuicompress: true,
paths: ['<%= assetsDir %>/less/font-awesome', '<%= assetsDir %>/tmp/font-awesome', '<%= bowerDir %>/font-awesome/less']
},
files: {
'<%= assetsDir %>/tmp/font-awesome.css': '<%= assetsDir %>/less/font-awesome/main.less'
}
}
},
concat: {
css: {
src: ['<%= assetsDir %>/tmp/bootstrap.css', '<%= assetsDir %>/tmp/font-awesome.css'],
dest: '<%= assetsDir %>/tmp/concat.css'
},
js: {
src: [
'<%= assetsDir %>/js/angular.js',
'<%= assetsDir %>/js/angular-cookies.js',
'<%= assetsDir %>/js/lodash.js',
'<%= assetsDir %>/js/angular-locale_en.js',
'<%= assetsDir %>/js/angular-resource.js',
'<%= assetsDir %>/js/restangular.js',
'<%= assetsDir %>/js/angular-route.js',
'<%= assetsDir %>/js/angular-sanitize.js',
'<%= assetsDir %>/js/angularLocalStorage.js',
'<%= assetsDir %>/js/angular-translate.js',
'<%= assetsDir %>/js/angular-file-upload.js',
'<%= assetsDir %>/js/ui-bootstrap-tpls.js',
'<%= assetsDir %>/js/angular-ui-router.js',
'<%= assetsDir %>/js/ng-table.js',
'<%= assetsDir %>/js/jquery.js',
'<%= assetsDir %>/js/bootstrap.js'
],
dest: '<%= assetsDir %>/tmp/concat.js'
}
},
cssmin: {
css: {
options: {
keepSpecialComments: 0
},
files: {
'<%= assetsDir %>/style.min.css': ['<%= assetsDir %>/tmp/concat.css']
}
}
},
uglify: {
options: {
preserveComments: false
},
my_target: {
files: {
'<%= assetsDir %>/script.min.js': ['<%= assetsDir %>/tmp/concat.js']
}
}
},
watch: {
files: ['<%= assetsDir %>/less/**/*.less'],
tasks: ['watching']
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['copy', 'less', 'concat', 'cssmin', 'uglify', 'clean']);
grunt.registerTask('watching', ['less', 'concat', 'cssmin', 'clean']);
};