fix
This commit is contained in:
parent
88b99fa86b
commit
faf7792a09
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 7.5 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 123 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.0 KiB |
|
|
@ -1,8 +1,5 @@
|
||||||
export const files = [
|
export const files = [
|
||||||
"favicon.ico",
|
"favicon.ico",
|
||||||
"img/empty.png",
|
|
||||||
"img/logo-white.png",
|
|
||||||
"img/logo.png",
|
|
||||||
"monaco/min/vs/basic-languages/postiats/postiats.js",
|
"monaco/min/vs/basic-languages/postiats/postiats.js",
|
||||||
"monaco/min/vs/basic-languages/scheme/scheme.js",
|
"monaco/min/vs/basic-languages/scheme/scheme.js",
|
||||||
"monaco/min/vs/basic-languages/sb/sb.js",
|
"monaco/min/vs/basic-languages/sb/sb.js",
|
||||||
|
|
@ -116,8 +113,5 @@ export const files = [
|
||||||
"monaco/min/vs/editor/editor.main.nls.es.js",
|
"monaco/min/vs/editor/editor.main.nls.es.js",
|
||||||
"monaco/min/vs/editor/editor.main.nls.js",
|
"monaco/min/vs/editor/editor.main.nls.js",
|
||||||
"monaco/min/vs/editor/editor.main.nls.fr.js",
|
"monaco/min/vs/editor/editor.main.nls.fr.js",
|
||||||
"monaco/min/vs/loader.js",
|
"monaco/min/vs/loader.js"
|
||||||
"img/empty.png",
|
|
||||||
"img/logo-white.png",
|
|
||||||
"img/logo.png"
|
|
||||||
]
|
]
|
||||||
|
|
@ -109,15 +109,13 @@ if (build_all) {
|
||||||
dir.path(`app/static`),
|
dir.path(`app/static`),
|
||||||
];
|
];
|
||||||
|
|
||||||
const parcel = spawn({
|
let build_static =
|
||||||
cmd: args,
|
process.argv[process.argv.length - 1] === "public" ? false : true;
|
||||||
cwd: dir.path("app/web"),
|
|
||||||
stdio: ["ignore", "inherit", "inherit"],
|
|
||||||
});
|
|
||||||
await parcel.exited;
|
|
||||||
|
|
||||||
// const public_br = dir.path("app/web/public-br");
|
if (!build_static) {
|
||||||
// await removeAsync(public_br);
|
const public_br = dir.path("app/web/public-br");
|
||||||
|
await removeAsync(public_br);
|
||||||
|
}
|
||||||
|
|
||||||
const api = new fdir().withRelativePaths().crawl(dir.path("app/web/public"));
|
const api = new fdir().withRelativePaths().crawl(dir.path("app/web/public"));
|
||||||
const public_files = api.sync();
|
const public_files = api.sync();
|
||||||
|
|
@ -153,30 +151,39 @@ if (build_all) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const static_br = dir.path("app/static-br");
|
if (build_static) {
|
||||||
await removeAsync(static_br);
|
const parcel = spawn({
|
||||||
const static_files = await listAsync(dir.path("app/static"));
|
cmd: args,
|
||||||
if (static_files) {
|
cwd: dir.path("app/web"),
|
||||||
await Promise.all(
|
stdio: ["ignore", "inherit", "inherit"],
|
||||||
static_files
|
});
|
||||||
.filter((file) => statSync(dir.path(`app/static/${file}`)).isFile())
|
await parcel.exited;
|
||||||
.map(async (file) => {
|
|
||||||
if (!(await Bun.file(dir.path(`app/static-br/${file}`)).exists())) {
|
const static_br = dir.path("app/static-br");
|
||||||
const br = brotli.compress(
|
await removeAsync(static_br);
|
||||||
new Uint8Array(
|
const static_files = await listAsync(dir.path("app/static"));
|
||||||
await Bun.file(dir.path(`app/static/${file}`)).arrayBuffer()
|
if (static_files) {
|
||||||
),
|
await Promise.all(
|
||||||
{ quality: 11 }
|
static_files
|
||||||
);
|
.filter((file) => statSync(dir.path(`app/static/${file}`)).isFile())
|
||||||
if (br) {
|
.map(async (file) => {
|
||||||
console.log(`Compressing [static] ${file}`);
|
if (!(await Bun.file(dir.path(`app/static-br/${file}`)).exists())) {
|
||||||
await writeAsync(
|
const br = brotli.compress(
|
||||||
dir.path(`app/static-br/${file}`),
|
new Uint8Array(
|
||||||
Buffer.from(br)
|
await Bun.file(dir.path(`app/static/${file}`)).arrayBuffer()
|
||||||
|
),
|
||||||
|
{ quality: 11 }
|
||||||
);
|
);
|
||||||
|
if (br) {
|
||||||
|
console.log(`Compressing [static] ${file}`);
|
||||||
|
await writeAsync(
|
||||||
|
dir.path(`app/static-br/${file}`),
|
||||||
|
Buffer.from(br)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue