Skip to content

Commit 07906c2

Browse files
committed
Implement brotli support in build tool chain
1 parent 1f4990f commit 07906c2

File tree

10 files changed

+18
-1
lines changed

10 files changed

+18
-1
lines changed

config/webpack.prod.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,23 @@ module.exports = {
112112
"/[base].gz",
113113
algorithm: "gzip",
114114
exclude: /.map$/,
115-
deleteOriginalAssets: "keep-source-map",
115+
deleteOriginalAssets: false,
116116
}),
117+
new Compression({
118+
test: /\.(html)$/,
119+
filename:
120+
"[path]../dist/" +
121+
target +
122+
"/" +
123+
subtarget +
124+
"/[base].br",
125+
algorithm: "brotliCompress",
126+
compressionOptions: {
127+
level: 11, // max compression
128+
},
129+
exclude: /.map$/,
130+
deleteOriginalAssets: false,
131+
}),
117132
]),
118133
...(runAnalyzer
119134
? [

dist/CNC/GRBL/index.html.br

75.6 KB
Binary file not shown.

dist/CNC/GRBLHal/index.html.br

78.8 KB
Binary file not shown.
79.7 KB
Binary file not shown.
80.1 KB
Binary file not shown.
79.1 KB
Binary file not shown.
78.7 KB
Binary file not shown.

dist/SandTable/GRBL/index.html.br

69.1 KB
Binary file not shown.

dist/fallback _proposed.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!doctype html><html lang=en><meta charset=utf-8><title>Unsupported</title><body style="font-family:sans-serif;text-align:center;padding:2em"><h2>Unsupported Browser</h2><p>No Brotli support.</p><p>Use a modern browser or gzip WebUI.</p></body></html>

dist/fallback.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<html lang=en><title>Sorry!</title><body><center><h2>Unsupported Browser for this WebUI</h2>Sorry, it seems your browser does not support Brotli.<br>Please use a modern browser or update to the gzip WebUI version.</center></body></html>

0 commit comments

Comments
 (0)