2025-01-13 08:00:21 +00:00
|
|
|
import { spawnSync, SpawnSyncOptions } from "child_process";
|
2024-11-05 11:12:42 +00:00
|
|
|
|
|
|
|
console.log("Running Post build ...");
|
|
|
|
|
|
|
|
try {
|
2025-01-13 08:00:21 +00:00
|
|
|
const spawnSyncOptions: SpawnSyncOptions = {
|
2024-11-05 11:12:42 +00:00
|
|
|
stdio: "inherit",
|
|
|
|
encoding: "utf-8",
|
|
|
|
cwd: process.cwd(),
|
|
|
|
env: {
|
|
|
|
...process.env,
|
|
|
|
NODE_ENV: "production",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const generateSitemap = spawnSync(
|
2025-01-13 08:00:21 +00:00
|
|
|
"bunx",
|
2024-11-05 11:12:42 +00:00
|
|
|
["next-sitemap"],
|
|
|
|
spawnSyncOptions
|
|
|
|
);
|
2025-01-13 21:25:20 +00:00
|
|
|
|
|
|
|
console.log("Post Build Success! Starting Server ...");
|
2024-11-05 11:12:42 +00:00
|
|
|
} catch (error) {
|
|
|
|
console.log("Post Build Error =>", error);
|
|
|
|
}
|