nuxt-site-config 0.8.3 → 0.8.5

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.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "bridge": false
6
6
  },
7
7
  "configKey": "site",
8
- "version": "0.8.3"
8
+ "version": "0.8.5"
9
9
  }
@@ -8,7 +8,7 @@ export function createSitePathResolver(options = {}) {
8
8
  return computed(() => resolveSitePath(unref(path), {
9
9
  absolute: unref(options.absolute),
10
10
  withBase: unref(options.withBase),
11
- siteUrl: unref(options.canonical) !== false ? siteConfig.url : nitroOrigin,
11
+ siteUrl: unref(options.canonical) !== false || process.env.prerender ? siteConfig.url : nitroOrigin,
12
12
  trailingSlash: siteConfig.trailingSlash,
13
13
  base: nuxtBase
14
14
  }));
@@ -27,7 +27,7 @@ export function withSiteUrl(path, options = {}) {
27
27
  return computed(() => {
28
28
  return resolveSitePath(unref(path), {
29
29
  absolute: true,
30
- siteUrl: unref(options.canonical) !== false ? siteConfig.url : nitroOrigin,
30
+ siteUrl: unref(options.canonical) !== false || process.env.prerender ? siteConfig.url : nitroOrigin,
31
31
  trailingSlash: siteConfig.trailingSlash,
32
32
  base,
33
33
  withBase: options.withBase
@@ -7,7 +7,7 @@ export function withSiteUrl(e, path, options = {}) {
7
7
  const siteConfig = e.context.siteConfig?.get();
8
8
  return resolveSitePath(path, {
9
9
  absolute: true,
10
- siteUrl: options.canonical !== false ? siteConfig.url : e.context.siteConfigNitroOrigin,
10
+ siteUrl: options.canonical !== false || process.env.prerender ? siteConfig.url : e.context.siteConfigNitroOrigin,
11
11
  trailingSlash: siteConfig.trailingSlash,
12
12
  base: e.context.nitro.baseURL,
13
13
  withBase: options.withBase
@@ -16,5 +16,11 @@ export default eventHandler((e) => {
16
16
  ...appConfig.site
17
17
  });
18
18
  }
19
+ if (e.context._nitro.routeRules.site) {
20
+ updateSiteConfig(e, {
21
+ _context: "route-rules",
22
+ ...e.context._nitro.routeRules.site
23
+ });
24
+ }
19
25
  }
20
26
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-site-config",
3
3
  "type": "module",
4
- "version": "0.8.3",
4
+ "version": "0.8.5",
5
5
  "packageManager": "pnpm@8.6.5",
6
6
  "description": "Shared site configuration for Nuxt 3 modules.",
7
7
  "license": "MIT",
@@ -29,8 +29,8 @@
29
29
  "dependencies": {
30
30
  "@nuxt/kit": "3.6.1",
31
31
  "ufo": "^1.1.2",
32
- "nuxt-site-config-kit": "0.8.3",
33
- "site-config-stack": "0.8.3"
32
+ "nuxt-site-config-kit": "0.8.5",
33
+ "site-config-stack": "0.8.5"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "nuxt-module-build --stub && nuxt-module-build prepare && nuxt-module-build",