Commit 60046e8353fa070cf5bf6c5161d7db99099c0175
1 parent
2825a968
Reduce UI resources size. UI resources compression support.
Showing
6 changed files
with
25 additions
and
11 deletions
... | ... | @@ -328,6 +328,13 @@ spring.mvc.cors: |
328 | 328 | max-age: "1800" |
329 | 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 | 338 | # HSQLDB DAO Configuration |
332 | 339 | spring: |
333 | 340 | data: | ... | ... |
... | ... | @@ -15,7 +15,6 @@ |
15 | 15 | }, |
16 | 16 | "dependencies": { |
17 | 17 | "@flowjs/ng-flow": "^2.7.1", |
18 | - "ace-builds": "1.3.1", | |
19 | 18 | "angular": "1.5.8", |
20 | 19 | "angular-animate": "1.5.8", |
21 | 20 | "angular-aria": "1.5.8", |
... | ... | @@ -47,7 +46,7 @@ |
47 | 46 | "angular-ui-router": "^0.3.1", |
48 | 47 | "angular-websocket": "^2.0.1", |
49 | 48 | "base64-js": "^1.2.1", |
50 | - "brace": "^0.8.0", | |
49 | + "brace": "^0.10.0", | |
51 | 50 | "canvas-gauges": "^2.0.9", |
52 | 51 | "clipboard": "^1.5.15", |
53 | 52 | "compass-sass-mixins": "^0.12.7", |
... | ... | @@ -96,6 +95,7 @@ |
96 | 95 | "babel-loader": "^6.2.5", |
97 | 96 | "babel-preset-es2015": "^6.14.0", |
98 | 97 | "babel-preset-react": "^6.16.0", |
98 | + "compression-webpack-plugin": "^1.1.11", | |
99 | 99 | "connect-history-api-fallback": "^1.3.0", |
100 | 100 | "copy-webpack-plugin": "^3.0.1", |
101 | 101 | "cross-env": "^3.2.4", | ... | ... |
... | ... | @@ -18,8 +18,8 @@ import './json-content.scss'; |
18 | 18 | import 'brace/ext/language_tools'; |
19 | 19 | import 'brace/mode/json'; |
20 | 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 | 24 | import fixAceEditor from './ace-editor-fix'; |
25 | 25 | ... | ... |
... | ... | @@ -17,7 +17,7 @@ import './json-object-edit.scss'; |
17 | 17 | |
18 | 18 | import 'brace/ext/language_tools'; |
19 | 19 | import 'brace/mode/json'; |
20 | -import 'ace-builds/src-min-noconflict/snippets/json'; | |
20 | +import 'brace/snippets/json'; | |
21 | 21 | |
22 | 22 | import fixAceEditor from './ace-editor-fix'; |
23 | 23 | ... | ... |
... | ... | @@ -20,12 +20,11 @@ import 'brace/mode/javascript'; |
20 | 20 | import 'brace/mode/html'; |
21 | 21 | import 'brace/mode/css'; |
22 | 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 | 29 | /* eslint-disable import/no-unresolved, import/default */ |
31 | 30 | ... | ... |
... | ... | @@ -18,6 +18,7 @@ |
18 | 18 | const HtmlWebpackPlugin = require('html-webpack-plugin'); |
19 | 19 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); |
20 | 20 | const CopyWebpackPlugin = require('copy-webpack-plugin'); |
21 | +const CompressionPlugin = require('compression-webpack-plugin'); | |
21 | 22 | const webpack = require('webpack'); |
22 | 23 | const path = require('path'); |
23 | 24 | |
... | ... | @@ -64,6 +65,13 @@ module.exports = { |
64 | 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 | 76 | node: { |
69 | 77 | tls: "empty", | ... | ... |