diff --git a/admin/bando/Bandolier.svelte b/admin/bando/Bandolier.svelte index bef99e9..56ca223 100644 --- a/admin/bando/Bandolier.svelte +++ b/admin/bando/Bandolier.svelte @@ -103,13 +103,13 @@ {:else if has_errors} - + Errors diff --git a/commands/build.js b/commands/build.js index 3451c71..6c888eb 100644 --- a/commands/build.js +++ b/commands/build.js @@ -76,11 +76,11 @@ const syncContent = (watch_pattern) => ({ }); build.onEnd(async (result) => { + socket.emit("/reloader/notify", {}); + if(result.errors.length > 0) { console.error(`Build ended with ${result.errors.length} errors`); } else { - socket.emit("/reloader/notify", {}); - if(process.platform === "win32") { try { exec_i("robocopy static\\ public\\ /e /NFL /NDL /NJH /NJS /nc /ns /np"); @@ -101,8 +101,12 @@ const saveMetaFile = (build_meta, error_file) => ({ name: "saveMetaFile", setup(build) { build.onEnd(async (result) => { - mkdir_to(build_meta); - await fs.writeFile(build_meta, JSON.stringify(result.metafile, null, 4)); + // when there's an error esbuild doesn't include the metafile portion + if(result.metafile) { + mkdir_to(build_meta); + await fs.writeFile(build_meta, JSON.stringify(result.metafile, null, 4)); + } + mkdir_to(error_file); await fs.writeFile(error_file, JSON.stringify(result, null, 4)); });