|
|
|
@ -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) => { |
|
|
|
|
// 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)); |
|
|
|
|
}); |
|
|
|
|