24 lines
539 B
TypeScript
Executable File
24 lines
539 B
TypeScript
Executable File
import { spawnSync, SpawnSyncOptions } from "child_process";
|
|
|
|
console.log("Running Post build ...");
|
|
|
|
try {
|
|
const spawnSyncOptions: SpawnSyncOptions = {
|
|
stdio: "inherit",
|
|
encoding: "utf-8",
|
|
cwd: process.cwd(),
|
|
env: {
|
|
...process.env,
|
|
NODE_ENV: "production",
|
|
},
|
|
};
|
|
|
|
const generateSitemap = spawnSync(
|
|
"bunx",
|
|
["next-sitemap"],
|
|
spawnSyncOptions
|
|
);
|
|
} catch (error) {
|
|
console.log("Post Build Error =>", error);
|
|
}
|