Skip to content

Commit

Permalink
fix(build): don't exit process until files are written
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Sep 6, 2024
1 parent 4def402 commit 265e62b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@ const client = await getContext('client', {
});

async function build() {
return Promise.all([server.rebuild(), client.rebuild()]).then(() => {
writeFile('.yarn.installed', new Date().toISOString());
writeFile(
'fxmanifest.lua',
`fx_version 'cerulean'
const built = await Promise.all([server.rebuild(), client.rebuild()]);

if (!built) return;

await writeFile('.yarn.installed', new Date().toISOString());
await writeFile(
'fxmanifest.lua',
`fx_version 'cerulean'
game 'gta5'
name '${pkg.name}'
Expand All @@ -91,8 +94,7 @@ client_script 'dist/client.js'
server_script 'dist/server.js'
`
);
});
);
}

const tsc = spawn(`tsc --build ${production ? '' : '--watch --preserveWatchOutput'} && tsc-alias`, {
Expand Down

0 comments on commit 265e62b

Please sign in to comment.