Skip to content

Commit 1413bbb

Browse files
committed
simpler code
1 parent 6378826 commit 1413bbb

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

tools/server/public/index.html.gz

6.18 KB
Binary file not shown.

tools/server/webui/vite.config.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,12 @@ const BUILD_PLUGINS = [
3333
},
3434
writeBundle() {
3535
const outputIndexHtml = path.join(config.build.outDir, 'index.html');
36-
const content =
36+
let content =
3737
GUIDE_FOR_FRONTEND + '\n' + fs.readFileSync(outputIndexHtml, 'utf-8');
38-
const deflator = new pako.Deflate({
38+
content = content.replace(/\r/g, ''); // remove windows-style line endings
39+
const compressed = pako.deflate(content, {
3940
level: 9,
40-
header: {
41-
text: true,
42-
os: 0,
43-
time: 0,
44-
extra: [],
45-
name: '',
46-
comment: '',
47-
hcrc: true,
48-
}
4941
});
50-
deflator.push(content, true);
51-
if (deflator.err) {
52-
console.error(deflator.msg);
53-
process.exit(1);
54-
}
55-
const compressed = deflator.result as Uint8Array;
5642

5743
// because gzip header contains machine-specific info, we must remove these data from the header
5844
// timestamp

0 commit comments

Comments
 (0)