fix
This commit is contained in:
parent
7e9efb848a
commit
611ac7db24
|
|
@ -69,15 +69,20 @@ if (files) {
|
||||||
files
|
files
|
||||||
.filter((file) => statSync(dir.path(`app/static/${file}`)).isFile())
|
.filter((file) => statSync(dir.path(`app/static/${file}`)).isFile())
|
||||||
.map(async (file) => {
|
.map(async (file) => {
|
||||||
const br = brotli.compress(
|
if (!(await Bun.file(dir.path(`app/static-br/${file}`)).exists())) {
|
||||||
new Uint8Array(
|
const br = brotli.compress(
|
||||||
await Bun.file(dir.path(`app/static/${file}`)).arrayBuffer()
|
new Uint8Array(
|
||||||
),
|
await Bun.file(dir.path(`app/static/${file}`)).arrayBuffer()
|
||||||
{ quality: 11 }
|
),
|
||||||
);
|
{ quality: 11 }
|
||||||
if (br) {
|
);
|
||||||
console.log(`Compressing ${file}`);
|
if (br) {
|
||||||
await writeAsync(dir.path(`app/static-br/${file}`), Buffer.from(br));
|
console.log(`Compressing ${file}`);
|
||||||
|
await writeAsync(
|
||||||
|
dir.path(`app/static-br/${file}`),
|
||||||
|
Buffer.from(br)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue