|
|
@ -76,11 +76,11 @@ const syncContent = (watch_pattern) => ({ |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
build.onEnd(async (result) => { |
|
|
|
build.onEnd(async (result) => { |
|
|
|
|
|
|
|
socket.emit("/reloader/notify", {}); |
|
|
|
|
|
|
|
|
|
|
|
if(result.errors.length > 0) { |
|
|
|
if(result.errors.length > 0) { |
|
|
|
console.error(`Build ended with ${result.errors.length} errors`); |
|
|
|
console.error(`Build ended with ${result.errors.length} errors`); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
socket.emit("/reloader/notify", {}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(process.platform === "win32") { |
|
|
|
if(process.platform === "win32") { |
|
|
|
try { |
|
|
|
try { |
|
|
|
exec_i("robocopy static\\ public\\ /e /NFL /NDL /NJH /NJS /nc /ns /np"); |
|
|
|
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", |
|
|
|
name: "saveMetaFile", |
|
|
|
setup(build) { |
|
|
|
setup(build) { |
|
|
|
build.onEnd(async (result) => { |
|
|
|
build.onEnd(async (result) => { |
|
|
|
|
|
|
|
// when there's an error esbuild doesn't include the metafile portion
|
|
|
|
|
|
|
|
if(result.metafile) { |
|
|
|
mkdir_to(build_meta); |
|
|
|
mkdir_to(build_meta); |
|
|
|
await fs.writeFile(build_meta, JSON.stringify(result.metafile, null, 4)); |
|
|
|
await fs.writeFile(build_meta, JSON.stringify(result.metafile, null, 4)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mkdir_to(error_file); |
|
|
|
mkdir_to(error_file); |
|
|
|
await fs.writeFile(error_file, JSON.stringify(result, null, 4)); |
|
|
|
await fs.writeFile(error_file, JSON.stringify(result, null, 4)); |
|
|
|
}); |
|
|
|
}); |
|
|
|