27 lines
602 B
JavaScript
Executable File
27 lines
602 B
JavaScript
Executable File
// @ts-check
|
|
|
|
const { spawnSync } = require("child_process");
|
|
|
|
console.log("Running Post build ...");
|
|
|
|
try {
|
|
/** @type {import('child_process').SpawnSyncOptionsWithStringEncoding} */
|
|
const spawnSyncOptions = {
|
|
stdio: "inherit",
|
|
encoding: "utf-8",
|
|
cwd: process.cwd(),
|
|
env: {
|
|
...process.env,
|
|
NODE_ENV: "production",
|
|
},
|
|
};
|
|
|
|
const generateSitemap = spawnSync(
|
|
"npx",
|
|
["next-sitemap"],
|
|
spawnSyncOptions
|
|
);
|
|
} catch (error) {
|
|
console.log("Post Build Error =>", error);
|
|
}
|