mod-build 4.0.89 → 4.0.90-beta.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.90
4
+
5
+ - Expose the site config `domain` on the client as `window.siteDomain` via `globalFunctions()`
6
+
3
7
  ## 4.0.89
4
8
 
5
9
  - Updated the `${apiDomain}utils/vendor-display-name` API to use `publicKey=` as the param to grab the branded display name (which is needed for QMP2.0). Also updated all instances of `vendorPublicIdentifier` to `publicKey` since that is what the field is called now.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.89",
3
+ "version": "4.0.90-beta.2",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -4,6 +4,17 @@ import { showUtilityProviders } from './default/show-utility-providers.js';
4
4
 
5
5
  function globalFunctions(config) {
6
6
  window.gtm_container_ID = config.gtm_container_ID;
7
+ const { domain, pathSubdirectory } = config;
8
+ if (domain) {
9
+ if (domain.includes('/')) {
10
+ window.siteDomain = domain;
11
+ } else if (pathSubdirectory && typeof pathSubdirectory === 'string') {
12
+ const trimmedPath = pathSubdirectory.replace(/^\/+|\/+$/g, '');
13
+ window.siteDomain = trimmedPath ? `${domain}/${trimmedPath}` : domain;
14
+ } else {
15
+ window.siteDomain = domain;
16
+ }
17
+ }
7
18
  updateFooterLinkPaths(config);
8
19
  }
9
20