@cwa/nuxt-edge 1.0.0-29318132.eefd66f → 1.0.0-29319648.edf4e33

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/dist/module.mjs CHANGED
@@ -48,7 +48,7 @@ const module = defineNuxtModule({
48
48
  sitemaps: {
49
49
  cwa: {
50
50
  sources: ["/__sitemap__/cwa-urls"],
51
- chunks: true
51
+ chunks: false
52
52
  }
53
53
  }
54
54
  }
@@ -55,10 +55,13 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
55
55
  }
56
56
  };
57
57
  if (!isClient) {
58
- return;
58
+ nuxtApp.$cwa.siteConfig.loadConfig();
59
+ const resource = await nuxtApp.$cwa.fetchRoute(to);
60
+ return handleRouteRedirect(resource);
59
61
  }
60
62
  const isFirstClientSideRun = nuxtApp.isHydrating && nuxtApp.payload.serverRendered;
61
63
  if (isFirstClientSideRun && from.fullPath === to.fullPath) {
64
+ return;
62
65
  }
63
66
  const startedMiddlewareToken = middlewareToken;
64
67
  nuxtApp.$cwa.fetchRoute(to).then(async (resource) => {
@@ -41,6 +41,9 @@ const fallbackTitle = computed(() => {
41
41
  const lastSegment = path.split("/").pop();
42
42
  return lastSegment ? titleCase(lastSegment) : null;
43
43
  });
44
+ const metaDescription = computed(() => {
45
+ return $cwa.resources.pageData?.value?.data?.metaDescription || $cwa.resources.page?.value?.data?.metaDescription;
46
+ });
44
47
  useHead({
45
48
  title: () => {
46
49
  const userDefinedTitle = $cwa.resources.pageData?.value?.data?.title || $cwa.resources.page?.value?.data?.title;
@@ -50,7 +53,7 @@ useHead({
50
53
  return userDefinedTitle;
51
54
  },
52
55
  meta: [
53
- { name: "description", content: () => $cwa.resources.pageData?.value?.data?.metaDescription || $cwa.resources.page?.value?.data?.metaDescription }
56
+ { name: "description", content: metaDescription }
54
57
  ]
55
58
  }, minimalPriority);
56
59
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cwa/nuxt-edge",
3
- "version": "1.0.0-29318132.eefd66f",
3
+ "version": "1.0.0-29319648.edf4e33",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Components Web Apps Nuxt Module. UI for creating component-driven web apps with the API Components Bundle",