fix
This commit is contained in:
parent
7e9efb848a
commit
611ac7db24
|
|
@ -69,6 +69,7 @@ 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) => {
|
||||||
|
if (!(await Bun.file(dir.path(`app/static-br/${file}`)).exists())) {
|
||||||
const br = brotli.compress(
|
const br = brotli.compress(
|
||||||
new Uint8Array(
|
new Uint8Array(
|
||||||
await Bun.file(dir.path(`app/static/${file}`)).arrayBuffer()
|
await Bun.file(dir.path(`app/static/${file}`)).arrayBuffer()
|
||||||
|
|
@ -77,7 +78,11 @@ if (files) {
|
||||||
);
|
);
|
||||||
if (br) {
|
if (br) {
|
||||||
console.log(`Compressing ${file}`);
|
console.log(`Compressing ${file}`);
|
||||||
await writeAsync(dir.path(`app/static-br/${file}`), Buffer.from(br));
|
await writeAsync(
|
||||||
|
dir.path(`app/static-br/${file}`),
|
||||||
|
Buffer.from(br)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue