@bootmap/wpep-cli 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/deploy.js +15 -1
package/package.json
CHANGED
package/src/commands/deploy.js
CHANGED
|
@@ -73,12 +73,26 @@ export default async function deployCommand(options) {
|
|
|
73
73
|
if (foundDir) {
|
|
74
74
|
console.log(chalk.gray(`Auto-detected build in "${foundDir}". Copying to "wpep-build"...`));
|
|
75
75
|
fs.cpSync(path.join(process.cwd(), foundDir), targetDir, { recursive: true });
|
|
76
|
+
} else if (fs.existsSync(path.join(process.cwd(), '.next'))) {
|
|
77
|
+
console.log(chalk.red.bold('\n⚠️ ERROR: No static export directory found, but a ".next" directory exists.'));
|
|
78
|
+
console.log(chalk.red('Next.js is currently building a Node.js server app, which cannot be hosted on WordPress.\n'));
|
|
79
|
+
|
|
80
|
+
console.log(chalk.yellow.bold('--- How to fix your Next.js App ---'));
|
|
81
|
+
console.log(chalk.yellow('To actually make your deployment work, you MUST configure Next.js to export static HTML.'));
|
|
82
|
+
console.log(chalk.yellow('Open your next.config.ts (or .js) and add `output: "export"` inside your config object:\n'));
|
|
83
|
+
|
|
84
|
+
console.log(chalk.cyan('const nextConfig: NextConfig = {'));
|
|
85
|
+
console.log(chalk.green(' output: "export",'));
|
|
86
|
+
console.log(chalk.cyan(' // ... rest of your config'));
|
|
87
|
+
console.log(chalk.cyan('};\n'));
|
|
88
|
+
|
|
89
|
+
process.exit(1);
|
|
76
90
|
}
|
|
77
91
|
}
|
|
78
92
|
|
|
79
93
|
outputDir = 'wpep-build';
|
|
80
94
|
const outDir = path.join(process.cwd(), outputDir);
|
|
81
|
-
|
|
95
|
+
|
|
82
96
|
if (!fs.existsSync(outDir)) {
|
|
83
97
|
throw new Error(`Export directory "${outputDir}" does not exist. Did the build succeed?`);
|
|
84
98
|
}
|