Commit 60046e8353fa070cf5bf6c5161d7db99099c0175

Authored by Igor Kulikov
1 parent 2825a968

Reduce UI resources size. UI resources compression support.

@@ -328,6 +328,13 @@ spring.mvc.cors: @@ -328,6 +328,13 @@ spring.mvc.cors:
328 max-age: "1800" 328 max-age: "1800"
329 allow-credentials: "true" 329 allow-credentials: "true"
330 330
  331 +# spring serve gzip compressed static resources
  332 +spring.resources.chain:
  333 + gzipped: "true"
  334 + strategy:
  335 + content:
  336 + enabled: "true"
  337 +
331 # HSQLDB DAO Configuration 338 # HSQLDB DAO Configuration
332 spring: 339 spring:
333 data: 340 data:
@@ -15,7 +15,6 @@ @@ -15,7 +15,6 @@
15 }, 15 },
16 "dependencies": { 16 "dependencies": {
17 "@flowjs/ng-flow": "^2.7.1", 17 "@flowjs/ng-flow": "^2.7.1",
18 - "ace-builds": "1.3.1",  
19 "angular": "1.5.8", 18 "angular": "1.5.8",
20 "angular-animate": "1.5.8", 19 "angular-animate": "1.5.8",
21 "angular-aria": "1.5.8", 20 "angular-aria": "1.5.8",
@@ -47,7 +46,7 @@ @@ -47,7 +46,7 @@
47 "angular-ui-router": "^0.3.1", 46 "angular-ui-router": "^0.3.1",
48 "angular-websocket": "^2.0.1", 47 "angular-websocket": "^2.0.1",
49 "base64-js": "^1.2.1", 48 "base64-js": "^1.2.1",
50 - "brace": "^0.8.0", 49 + "brace": "^0.10.0",
51 "canvas-gauges": "^2.0.9", 50 "canvas-gauges": "^2.0.9",
52 "clipboard": "^1.5.15", 51 "clipboard": "^1.5.15",
53 "compass-sass-mixins": "^0.12.7", 52 "compass-sass-mixins": "^0.12.7",
@@ -96,6 +95,7 @@ @@ -96,6 +95,7 @@
96 "babel-loader": "^6.2.5", 95 "babel-loader": "^6.2.5",
97 "babel-preset-es2015": "^6.14.0", 96 "babel-preset-es2015": "^6.14.0",
98 "babel-preset-react": "^6.16.0", 97 "babel-preset-react": "^6.16.0",
  98 + "compression-webpack-plugin": "^1.1.11",
99 "connect-history-api-fallback": "^1.3.0", 99 "connect-history-api-fallback": "^1.3.0",
100 "copy-webpack-plugin": "^3.0.1", 100 "copy-webpack-plugin": "^3.0.1",
101 "cross-env": "^3.2.4", 101 "cross-env": "^3.2.4",
@@ -18,8 +18,8 @@ import './json-content.scss'; @@ -18,8 +18,8 @@ import './json-content.scss';
18 import 'brace/ext/language_tools'; 18 import 'brace/ext/language_tools';
19 import 'brace/mode/json'; 19 import 'brace/mode/json';
20 import 'brace/mode/text'; 20 import 'brace/mode/text';
21 -import 'ace-builds/src-min-noconflict/snippets/json';  
22 -import 'ace-builds/src-min-noconflict/snippets/text'; 21 +import 'brace/snippets/json';
  22 +import 'brace/snippets/text';
23 23
24 import fixAceEditor from './ace-editor-fix'; 24 import fixAceEditor from './ace-editor-fix';
25 25
@@ -17,7 +17,7 @@ import './json-object-edit.scss'; @@ -17,7 +17,7 @@ import './json-object-edit.scss';
17 17
18 import 'brace/ext/language_tools'; 18 import 'brace/ext/language_tools';
19 import 'brace/mode/json'; 19 import 'brace/mode/json';
20 -import 'ace-builds/src-min-noconflict/snippets/json'; 20 +import 'brace/snippets/json';
21 21
22 import fixAceEditor from './ace-editor-fix'; 22 import fixAceEditor from './ace-editor-fix';
23 23
@@ -20,12 +20,11 @@ import 'brace/mode/javascript'; @@ -20,12 +20,11 @@ import 'brace/mode/javascript';
20 import 'brace/mode/html'; 20 import 'brace/mode/html';
21 import 'brace/mode/css'; 21 import 'brace/mode/css';
22 import 'brace/mode/json'; 22 import 'brace/mode/json';
23 -import 'ace-builds/src-min-noconflict/ace';  
24 -import 'ace-builds/src-min-noconflict/snippets/javascript';  
25 -import 'ace-builds/src-min-noconflict/snippets/text';  
26 -import 'ace-builds/src-min-noconflict/snippets/html';  
27 -import 'ace-builds/src-min-noconflict/snippets/css';  
28 -import 'ace-builds/src-min-noconflict/snippets/json'; 23 +import 'brace/snippets/javascript';
  24 +import 'brace/snippets/text';
  25 +import 'brace/snippets/html';
  26 +import 'brace/snippets/css';
  27 +import 'brace/snippets/json';
29 28
30 /* eslint-disable import/no-unresolved, import/default */ 29 /* eslint-disable import/no-unresolved, import/default */
31 30
@@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
18 const HtmlWebpackPlugin = require('html-webpack-plugin'); 18 const HtmlWebpackPlugin = require('html-webpack-plugin');
19 const ExtractTextPlugin = require('extract-text-webpack-plugin'); 19 const ExtractTextPlugin = require('extract-text-webpack-plugin');
20 const CopyWebpackPlugin = require('copy-webpack-plugin'); 20 const CopyWebpackPlugin = require('copy-webpack-plugin');
  21 +const CompressionPlugin = require('compression-webpack-plugin');
21 const webpack = require('webpack'); 22 const webpack = require('webpack');
22 const path = require('path'); 23 const path = require('path');
23 24
@@ -64,6 +65,13 @@ module.exports = { @@ -64,6 +65,13 @@ module.exports = {
64 NODE_ENV: JSON.stringify('production'), 65 NODE_ENV: JSON.stringify('production'),
65 }, 66 },
66 }), 67 }),
  68 + new CompressionPlugin({
  69 + asset: "[path].gz[query]",
  70 + algorithm: "gzip",
  71 + test: /\.js$|\.css$|\.svg$|\.ttf$|\.woff$|\.woff2|\.eot$/,
  72 + threshold: 10240,
  73 + minRatio: 0.8
  74 + })
67 ], 75 ],
68 node: { 76 node: {
69 tls: "empty", 77 tls: "empty",