nuxt-site-config 4.1.0 → 4.1.1

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
@@ -4,7 +4,7 @@
4
4
  "nuxt": ">=3.9.0"
5
5
  },
6
6
  "configKey": "site",
7
- "version": "4.1.0",
7
+ "version": "4.1.1",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineNuxtModule, createResolver, useLogger, addTypeTemplate, addImportsDir, addServerImportsDir, addPlugin, hasNuxtModule, hasNuxtModuleCompatibility, addTemplate, addServerHandler, addPrerenderRoutes, addServerPlugin } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, useLogger, addTypeTemplate, addImportsDir, addServerImportsDir, addServerTemplate, addPlugin, hasNuxtModule, hasNuxtModuleCompatibility, addTemplate, addServerHandler, addPrerenderRoutes, addServerPlugin } from '@nuxt/kit';
2
2
  import { initSiteConfig, updateSiteConfig, getSiteConfigStack } from 'nuxt-site-config-kit';
3
3
  import { setupDevToolsUI } from 'nuxtseo-shared/devtools';
4
4
  import { relative } from 'pathe';
@@ -136,6 +136,10 @@ export {}
136
136
  addServerImportsDir(resolve("./runtime/server/composables"));
137
137
  nuxt.options.alias["#site-config"] = resolve("./runtime");
138
138
  nuxt.options.build.transpile.push("site-config-stack");
139
+ addServerTemplate({
140
+ filename: "#nuxt-site-config/no-ssr.mjs",
141
+ getContents: () => `export const NUXT_SITE_CONFIG_NO_SSR = ${nuxt.options.ssr === false}`
142
+ });
139
143
  addPlugin({
140
144
  src: resolve("./runtime/app/plugins/0.siteConfig")
141
145
  });
@@ -1,6 +1,7 @@
1
1
  import devalue from "@nuxt/devalue";
2
2
  import { defineNitroPlugin, getRouteRules } from "nitropack/runtime";
3
3
  import { toValue } from "vue";
4
+ import { NUXT_SITE_CONFIG_NO_SSR } from "#nuxt-site-config/no-ssr.mjs";
4
5
  import { getSiteConfig } from "../composables/getSiteConfig.js";
5
6
  const PRERENDER_NO_SSR_ROUTES = /* @__PURE__ */ new Set(["/index.html", "/200.html", "/404.html"]);
6
7
  export default defineNitroPlugin(async (nitroApp) => {
@@ -8,7 +9,7 @@ export default defineNitroPlugin(async (nitroApp) => {
8
9
  const routeOptions = getRouteRules(event);
9
10
  const isIsland = process.env.NUXT_COMPONENT_ISLANDS && event.path.startsWith("/__nuxt_island");
10
11
  const url = event.path;
11
- const noSSR = !!process.env.NUXT_NO_SSR || event.context.nuxt?.noSSR || routeOptions.ssr === false && !isIsland || (import.meta.prerender ? PRERENDER_NO_SSR_ROUTES.has(url) : false);
12
+ const noSSR = !!NUXT_SITE_CONFIG_NO_SSR || !!process.env.NUXT_NO_SSR || event.context.nuxt?.noSSR || routeOptions.ssr === false && !isIsland || (import.meta.prerender ? PRERENDER_NO_SSR_ROUTES.has(url) : false);
12
13
  if (noSSR) {
13
14
  const siteConfig = Object.fromEntries(
14
15
  Object.entries(getSiteConfig(event)).map(([k, v]) => [k, toValue(v)])
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-site-config",
3
3
  "type": "module",
4
- "version": "4.1.0",
4
+ "version": "4.1.1",
5
5
  "description": "Shared site configuration for Nuxt 3 modules.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -52,16 +52,16 @@
52
52
  "@nuxt/devalue": "^2.0.2",
53
53
  "@nuxt/kit": "^4.4.8",
54
54
  "h3": "^1.15.11",
55
- "nuxtseo-layer-devtools": "^5.2.3",
56
- "nuxtseo-shared": "^5.2.3",
55
+ "nuxtseo-shared": "^5.3.0",
57
56
  "pathe": "^2.0.3",
58
57
  "pkg-types": "^2.3.1",
59
58
  "ufo": "^1.6.4",
60
- "nuxt-site-config-kit": "4.1.0",
61
- "site-config-stack": "4.1.0"
59
+ "nuxt-site-config-kit": "4.1.1",
60
+ "site-config-stack": "4.1.1"
62
61
  },
63
62
  "devDependencies": {
64
63
  "@nuxt/schema": "^4.4.8",
64
+ "nuxtseo-layer-devtools": "^5.3.0",
65
65
  "unbuild": "^3.6.1"
66
66
  },
67
67
  "build": {