@uniweb/build 0.15.1 → 0.15.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 +2 -2
- package/src/site/build-site-data.js +6 -3
- package/src/site/config.js +20 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/build",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"description": "Build tooling for the Uniweb Component Web Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@uniweb/content-writer": "0.2.7"
|
|
64
64
|
},
|
|
65
65
|
"optionalDependencies": {
|
|
66
|
-
"@uniweb/runtime": "0.8.
|
|
66
|
+
"@uniweb/runtime": "0.8.34",
|
|
67
67
|
"@uniweb/content-reader": "1.1.15",
|
|
68
68
|
"@uniweb/schemas": "0.2.4"
|
|
69
69
|
},
|
|
@@ -51,9 +51,12 @@ import { generateCollectionIndex } from '../search/collections.js'
|
|
|
51
51
|
* - `_pages/<route>.json` — only meaningful for static-host bundles
|
|
52
52
|
* where they're served as static assets. Worker derives them from
|
|
53
53
|
* `payload.locales[lang].pages[].sections` server-side.
|
|
54
|
-
* - `sitemap.xml`, `robots.txt
|
|
55
|
-
*
|
|
56
|
-
*
|
|
54
|
+
* - `sitemap.xml`, `robots.txt` — static-host bundle territory. Note these
|
|
55
|
+
* are simply absent from Uniweb-hosted sites today: nothing in platform
|
|
56
|
+
* generates them, at publish time or at request time.
|
|
57
|
+
* - `search-index.json` — the single-file bundle-mode form. Link mode emits
|
|
58
|
+
* the split `_search/{locale}/*.json` files instead (step 5 below), gated
|
|
59
|
+
* by `features: [search]`; those are what the hosting worker serves.
|
|
57
60
|
*
|
|
58
61
|
* @param {Object} params
|
|
59
62
|
* @param {string} params.siteRoot - Absolute path to the site directory.
|
package/src/site/config.js
CHANGED
|
@@ -263,12 +263,18 @@ export function readIntelligenceConfig(siteRoot) {
|
|
|
263
263
|
* @param {string} [options.base] - Base public path for deployment (e.g., '/demos/mysite/')
|
|
264
264
|
* @returns {Promise<Object>} Vite configuration
|
|
265
265
|
*/
|
|
266
|
+
/** De-duplicate a list, keeping first-seen order. */
|
|
267
|
+
function unique(list) {
|
|
268
|
+
return [...new Set(list)]
|
|
269
|
+
}
|
|
270
|
+
|
|
266
271
|
export async function defineSiteConfig(options = {}) {
|
|
267
272
|
const {
|
|
268
273
|
plugins: extraPlugins = [],
|
|
269
274
|
server: serverOverrides = {},
|
|
270
275
|
build: buildOverrides = {},
|
|
271
276
|
resolve: resolveOverrides = {},
|
|
277
|
+
optimizeDeps: optimizeDepsOverrides = {},
|
|
272
278
|
seo = {},
|
|
273
279
|
assets = {},
|
|
274
280
|
search = {},
|
|
@@ -575,9 +581,21 @@ export async function defineSiteConfig(options = {}) {
|
|
|
575
581
|
...buildOverrides
|
|
576
582
|
},
|
|
577
583
|
|
|
584
|
+
// `include` and `exclude` are unioned with anything the site adds rather
|
|
585
|
+
// than replaced by it. Every other key here is a value a caller can
|
|
586
|
+
// reasonably want to override outright; these two are lists of things that
|
|
587
|
+
// must be true, and the framework's entries are load-bearing — React has to
|
|
588
|
+
// be prebundled or the site gets two copies of it. A site adding one
|
|
589
|
+
// package to `exclude` is asking for one more exclusion, not volunteering
|
|
590
|
+
// to restate the framework's list, and getting that wrong is silent: the
|
|
591
|
+
// dev server starts, and the failure surfaces somewhere unrelated.
|
|
578
592
|
optimizeDeps: {
|
|
579
|
-
|
|
580
|
-
|
|
593
|
+
...optimizeDepsOverrides,
|
|
594
|
+
include: unique([
|
|
595
|
+
'react', 'react-dom', 'react-dom/client', 'react-dom/server', 'react-router-dom',
|
|
596
|
+
...(optimizeDepsOverrides.include || [])
|
|
597
|
+
]),
|
|
598
|
+
exclude: unique(['#foundation', ...(optimizeDepsOverrides.exclude || [])])
|
|
581
599
|
},
|
|
582
600
|
|
|
583
601
|
...restOptions
|