diff --git a/app/web/public-br/img/empty.png b/app/web/public-br/img/empty.png deleted file mode 100644 index 2f4147c9..00000000 Binary files a/app/web/public-br/img/empty.png and /dev/null differ diff --git a/app/web/public-br/img/logo-white.png b/app/web/public-br/img/logo-white.png deleted file mode 100644 index 432256ae..00000000 Binary files a/app/web/public-br/img/logo-white.png and /dev/null differ diff --git a/app/web/public-br/img/logo.png b/app/web/public-br/img/logo.png deleted file mode 100644 index 624eb763..00000000 Binary files a/app/web/public-br/img/logo.png and /dev/null differ diff --git a/app/web/public/img/empty.png b/app/web/public/img/empty.png deleted file mode 100644 index a395b09d..00000000 Binary files a/app/web/public/img/empty.png and /dev/null differ diff --git a/app/web/public/img/logo-white.png b/app/web/public/img/logo-white.png deleted file mode 100644 index bbb4af7b..00000000 Binary files a/app/web/public/img/logo-white.png and /dev/null differ diff --git a/app/web/public/img/logo.png b/app/web/public/img/logo.png deleted file mode 100644 index 8c15de2a..00000000 Binary files a/app/web/public/img/logo.png and /dev/null differ diff --git a/app/web/public_files.ts b/app/web/public_files.ts index c8581216..36ea2713 100644 --- a/app/web/public_files.ts +++ b/app/web/public_files.ts @@ -1,8 +1,5 @@ export const files = [ "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/scheme/scheme.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.js", "monaco/min/vs/editor/editor.main.nls.fr.js", - "monaco/min/vs/loader.js", - "img/empty.png", - "img/logo-white.png", - "img/logo.png" + "monaco/min/vs/loader.js" ] \ No newline at end of file diff --git a/pkgs/core/build.ts b/pkgs/core/build.ts index 9412bd37..c2e1212f 100644 --- a/pkgs/core/build.ts +++ b/pkgs/core/build.ts @@ -109,16 +109,14 @@ if (build_all) { dir.path(`app/static`), ]; - const parcel = spawn({ - cmd: args, - cwd: dir.path("app/web"), - stdio: ["ignore", "inherit", "inherit"], - }); - await parcel.exited; - - // const public_br = dir.path("app/web/public-br"); - // await removeAsync(public_br); + let build_static = + process.argv[process.argv.length - 1] === "public" ? false : true; + if (!build_static) { + 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 public_files = api.sync(); if (public_files) { @@ -153,30 +151,39 @@ if (build_all) { ); } - const static_br = dir.path("app/static-br"); - await removeAsync(static_br); - const static_files = await listAsync(dir.path("app/static")); - if (static_files) { - await Promise.all( - static_files - .filter((file) => statSync(dir.path(`app/static/${file}`)).isFile()) - .map(async (file) => { - if (!(await Bun.file(dir.path(`app/static-br/${file}`)).exists())) { - const br = brotli.compress( - new Uint8Array( - 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) + if (build_static) { + const parcel = spawn({ + cmd: args, + cwd: dir.path("app/web"), + stdio: ["ignore", "inherit", "inherit"], + }); + await parcel.exited; + + const static_br = dir.path("app/static-br"); + await removeAsync(static_br); + const static_files = await listAsync(dir.path("app/static")); + if (static_files) { + await Promise.all( + static_files + .filter((file) => statSync(dir.path(`app/static/${file}`)).isFile()) + .map(async (file) => { + if (!(await Bun.file(dir.path(`app/static-br/${file}`)).exists())) { + const br = brotli.compress( + new Uint8Array( + 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) + ); + } } - } - }) - ); + }) + ); + } } }