@lwrjs/client-modules 0.12.0-alpha.12 → 0.12.0-alpha.14

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.
@@ -1,2 +1,2 @@
1
- const e=[];let o;const t=globalThis.LWR;function n(){return t}globalThis.LWR.define?globalThis.LWR=Object.freeze({define:globalThis.LWR.define}):delete globalThis.LWR;const a={addLoaderPlugin:()=>{console.warn("API is not supported in ESM format")},handleStaleModule:function(t){e.push(t),o||(o=new WebSocket(`ws://${location.host}`),o.addEventListener("message",(async({data:o})=>{const t=JSON.parse(o);if("moduleUpdate"===t.eventType){const{oldHash:o,newHash:n,module:{specifier:a}}=t.payload;for(let t=0;t<e.length;t++){if(null!==(0,e[t])({name:a,oldHash:o,newHash:n}))break}}})))},appMetadata:function(){const{appId:e,bootstrapModule:o,rootComponent:t,rootComponents:a}=n();return{appId:e,bootstrapModule:o,rootComponent:t,rootComponents:a}}(),serverData:n().serverData||{}};export{a as services};
1
+ const e=[];let o;const n=globalThis.LWR;function t(){return n}n.define||n.env?globalThis.LWR=Object.freeze({define:n.define,env:n.env}):delete globalThis.LWR;const a={addLoaderPlugin:()=>{console.warn("API is not supported in ESM format")},handleStaleModule:function(n){e.push(n),o||(o=new WebSocket(`ws://${location.host}`),o.addEventListener("message",(async({data:o})=>{const n=JSON.parse(o);if("moduleUpdate"===n.eventType){const{oldHash:o,newHash:t,module:{specifier:a}}=n.payload;for(let n=0;n<e.length;n++){if(null!==(0,e[n])({name:a,oldHash:o,newHash:t}))break}}})))},appMetadata:function(){const{appId:e,bootstrapModule:o,rootComponent:n,rootComponents:a}=t();return{appId:e,bootstrapModule:o,rootComponent:n,rootComponents:a}}(),serverData:t().serverData||{}};export{a as services};
2
2
  //# sourceMappingURL=servicesESM.js.map
@@ -1,10 +1,10 @@
1
- const env = process && process.env;
2
- export const isServer = env && (env.SSR === 'true' || env.SSR === true);
1
+ const environment = globalThis?.LWR?.env || {};
2
+ export const isServer = environment && (environment.SSR === 'true' || environment.SSR === true);
3
3
  // The baseBath from the config or set from the request (e.g. /shop)
4
- export const basePath = env && env.basePath;
4
+ export const basePath = environment && environment.basePath;
5
5
  // The locale set from the request or the defaultLocale from the config (e.g. en-US)
6
- export const locale = env && env.locale;
6
+ export const locale = environment && environment.locale;
7
7
  // Root base path for static assets (e.g. /shop/mobify/bundle/1234/site)
8
- export const assetBasePath = env && env.assetBasePath;
8
+ export const assetBasePath = environment && environment.assetBasePath;
9
9
  // Base path for UI routing (e.g. /shop/en-US)
10
- export const uiBasePath = env && env.uiBasePath;
10
+ export const uiBasePath = environment && environment.uiBasePath;