@uniweb/build 0.6.1 → 0.6.3
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 +4 -4
- package/src/prerender.js +10 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/build",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "Build tooling for the Uniweb Component Web Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"sharp": "^0.33.2"
|
|
51
51
|
},
|
|
52
52
|
"optionalDependencies": {
|
|
53
|
-
"@uniweb/
|
|
54
|
-
"@uniweb/runtime": "0.5.
|
|
55
|
-
"@uniweb/
|
|
53
|
+
"@uniweb/content-reader": "1.1.2",
|
|
54
|
+
"@uniweb/runtime": "0.5.13",
|
|
55
|
+
"@uniweb/schemas": "0.2.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
package/src/prerender.js
CHANGED
|
@@ -92,7 +92,8 @@ function expandDynamicPages(pages, pageFetchedData, onProgress) {
|
|
|
92
92
|
const { paramName, parentSchema } = page
|
|
93
93
|
|
|
94
94
|
if (!parentSchema) {
|
|
95
|
-
onProgress(` Warning: Dynamic page ${page.route} has no parentSchema,
|
|
95
|
+
onProgress(` Warning: Dynamic page ${page.route} has no parentSchema, keeping as template for runtime`)
|
|
96
|
+
expandedPages.push(page)
|
|
96
97
|
continue
|
|
97
98
|
}
|
|
98
99
|
|
|
@@ -102,7 +103,10 @@ function expandDynamicPages(pages, pageFetchedData, onProgress) {
|
|
|
102
103
|
const parentData = pageFetchedData.get(parentRoute)
|
|
103
104
|
|
|
104
105
|
if (!parentData || !Array.isArray(parentData.data)) {
|
|
105
|
-
|
|
106
|
+
// No build-time data available (e.g., prerender: false on parent fetch).
|
|
107
|
+
// Keep the dynamic template so the runtime can match it client-side.
|
|
108
|
+
onProgress(` Keeping dynamic template ${page.route} for runtime (no build-time data)`)
|
|
109
|
+
expandedPages.push(page)
|
|
106
110
|
continue
|
|
107
111
|
}
|
|
108
112
|
|
|
@@ -700,6 +704,10 @@ export async function prerenderSite(siteDir, options = {}) {
|
|
|
700
704
|
const website = uniweb.activeWebsite
|
|
701
705
|
|
|
702
706
|
for (const page of pages) {
|
|
707
|
+
// Skip dynamic template pages — they exist in the content for runtime
|
|
708
|
+
// route matching but can't be pre-rendered (no concrete route)
|
|
709
|
+
if (page.route.includes(':')) continue
|
|
710
|
+
|
|
703
711
|
// Build the output route with locale prefix
|
|
704
712
|
// For non-default locales, translate route slugs (e.g., /about → /acerca-de)
|
|
705
713
|
const translatedPageRoute = isDefault ? page.route : website.translateRoute(page.route, locale)
|