2024-10-24 01:57:58 +00:00
|
|
|
import { unlink } from 'node:fs/promises';
|
|
|
|
|
|
|
|
const config = {
|
|
|
|
entrypoints: [ "./frontend/index.js" ],
|
|
|
|
outdir: "./static/js/",
|
|
|
|
};
|
2024-10-05 02:57:21 +00:00
|
|
|
|
2024-10-24 01:57:58 +00:00
|
|
|
async function fileExists(path: string): Promise<bool> {
|
|
|
|
const file = Bun.file(path);
|
|
|
|
return file.exists();
|
|
|
|
}
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
const results = await Bun.build({ ...config, verbose: true });
|
2024-10-05 02:57:21 +00:00
|
|
|
|
|
|
|
if (!results.success) {
|
|
|
|
for (const message of results.logs) {
|
|
|
|
console.error(message);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
main()
|
|
|
|
.then(() => {
|
|
|
|
process.exit(0)
|
|
|
|
})
|
|
|
|
.catch((e) => {
|
|
|
|
console.error(e);
|
|
|
|
process.exit(1);
|
|
|
|
});
|