8000 added frontend gzip support · ezhangle/arangodb@92ae28e · GitHub
[go: up one dir, main page]

Skip to content

Commit 92ae28e

Browse files
committed
added frontend gzip support
1 parent 9b98d74 commit 92ae28e

File tree

11 files changed

+888
-32
lines changed

11 files changed

+888
-32
lines changed

js/apps/system/_admin/aardvark/APP/GruntFile.js

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,79 @@
166166
}
167167
},
168168

169+
htmlmin: {
170+
dist: {
171+
options: {
172+
minifyJS: true,
173+
removeComments: true,
174+
collapseWhitespace: true
175+
},
176+
files: {
177+
'frontend/build/standalone-min.html' : 'frontend/build/standalone.html',
178+
'clusterFrontend/build/cluster-min.html' : 'clusterFrontend/build/cluster.html',
179+
'frontend/build/documentation-min.html' : 'frontend/html/documentation.html'
180+
}
181+
}
182+
},
183+
184+
compress: {
185+
main: {
186+
options: {
187+
mode: 'gzip'
188+
},
189+
files: [{
190+
expand: true,
191+
src: ['frontend/build/*min*.html'],
192+
dest: '.',
193+
ext: '.html.gz'
194+
}]
195+
},
196+
standaloneJS: {
197+
options: {
198+
mode: 'gzip'
199+
},
200+
files: [{
201+
expand: true,
202+
src: ['frontend/build/app.js'],
203+
dest: '.',
204+
ext: '.js.gz'
205+
}]
206+
},
207+
sharedJS: {
208+
options: {
209+
mode: 'gzip'
210+
},
211+
files: [{
212+
expand: true,
213+
src: ['build/sharedLibs.js'],
214+
dest: '.',
215+
ext: '.js.gz'
216+
}]
217+
},
218+
docuJS: {
219+
options: {
220+
mode: 'gzip'
221+
},
222+
files: [{
223+
expand: true,
224+
src: ['build/documentation.js'],
225+
dest: '.',
226+
ext: '.js.gz'
227+
}]
228+
},
229+
docuHTML: {
230+
options: {
231+
mode: 'gzip'
232+
},
233+
files: [{
234+
expand: true,
235+
src: ['build/documentation-min.html'],
236+
dest: '.',
237+
ext: '.html.gz'
238+
}]
239+
}
240+
},
241+
169242
cssmin: {
170243
dist: {
171244
options: {
@@ -337,10 +410,11 @@
337410
'<%=project.standalone.js %>'
338411
]
339412
},
340-
413+
341414
uglify: {
342415
dist: {
343416
files: {
417+
/*'frontend/build/templates-minified.js': ['frontend/js/templates/*.ejs']*/
344418
'frontend/build/app.min.js': 'frontend/build/app.js'
345419
}
346420
}
@@ -352,7 +426,7 @@
352426
'frontend/scss/{,*/}*.{scss,sass}',
353427
'clusterFrontend/scss/{,*/}*.{scss,sass}',
354428
],
355-
A3E2 tasks: ['sass:dev', 'cssmin']
429+
tasks: ['sass:dev', 'cssmin', 'gzip']
356430
},
357431
imagemin: {
358432
files: [
@@ -385,7 +459,8 @@
385459
],
386460
tasks: [
387461
'concat_in_order:htmlCluster',
388-
'concat_in_order:htmlStandalone'
462+
'concat_in_order:htmlStandalone',
463+
'htmlmin'
389464
]
390465
}
391466
}
@@ -394,7 +469,10 @@
394469
grunt.loadNpmTasks("grunt-sass");
395470
grunt.loadNpmTasks("grunt-contrib-imagemin");
396471
grunt.loadNpmTasks('grunt-contrib-cssmin');
472+
grunt.loadNpmTasks('grunt-contrib-compress');
397473
grunt.loadNpmTasks("grunt-contrib-concat");
474+
grunt.loadNpmTasks('grunt-contrib-htmlmin')
475+
grunt.loadNpmTasks('grunt-contrib-uglify')
398476

399477
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
400478
grunt.loadNpmTasks('grunt-text-replace');
@@ -404,13 +482,15 @@
404482
'jshint:default',
405483
'replace',
406484
'imagemin',
407-
'cssmin',
408485
'concat',
409486
'concat_in_order:sharedLibs',
410487
'concat_in_order:default',
411488
'concat_in_order:jsCluster',
412489
'concat_in_order:htmlCluster',
413490
'concat_in_order:htmlStandalone',
491+
'cssmin',
492+
'htmlmin',
493+
'compress',
414494
'watch'
415495
]);
416496

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!DOCTYPE html><html lang="en" xmlns="http://www.w3.org/1999/html"><head><meta charset="utf-8"><title>ArangoDB Foxx Documentation</title><meta name="description" content="ArangoDB Foxx Documentation"><meta name="author" content="Michael Hackstein"><link href="css/style.css" rel="stylesheet"><link href="css/sass.css" rel="stylesheet"><link rel="shortcut icon" type="image/x-icon" href="favicon.ico"></head><body><div class="headerBar"><a class="arangoHeader">API - Documentation</a></div><div class="form-actions api-actions"><div id="swagger-ui-container" class="swagger-ui-wrap"></div></div><script src="documentation.js"></script></body></html>
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)
0