meno-core 1.0.26 → 1.0.27
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/build-static.ts +13 -1
- package/package.json +1 -1
package/build-static.ts
CHANGED
|
@@ -786,7 +786,19 @@ export async function buildStaticPages(): Promise<void> {
|
|
|
786
786
|
process.exit(1);
|
|
787
787
|
}
|
|
788
788
|
|
|
789
|
-
|
|
789
|
+
// Recursively collect all .json page files (supports nested folders like pages/a/b.json)
|
|
790
|
+
const pageFiles: string[] = [];
|
|
791
|
+
function scanPagesDir(dir: string, prefix: string): void {
|
|
792
|
+
const entries = readdirSync(dir, { withFileTypes: true });
|
|
793
|
+
for (const entry of entries) {
|
|
794
|
+
if (entry.isFile() && entry.name.endsWith('.json')) {
|
|
795
|
+
pageFiles.push(prefix ? `${prefix}/${entry.name}` : entry.name);
|
|
796
|
+
} else if (entry.isDirectory()) {
|
|
797
|
+
scanPagesDir(join(dir, entry.name), prefix ? `${prefix}/${entry.name}` : entry.name);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
scanPagesDir(pagesDir, '');
|
|
790
802
|
|
|
791
803
|
if (pageFiles.length === 0) {
|
|
792
804
|
console.warn("⚠️ No pages found in ./pages directory");
|