nuxt-site-config-kit 1.4.0 → 1.5.0
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/index.cjs +11 -1
- package/dist/index.mjs +12 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ async function initSiteConfig(nuxt = kit.tryUseNuxt()) {
|
|
|
24
24
|
_context: "system",
|
|
25
25
|
_priority: -15,
|
|
26
26
|
name: rootDir ? rootDir.split("/").pop() : void 0,
|
|
27
|
-
|
|
27
|
+
env: stdEnv.env.NODE_ENV
|
|
28
28
|
});
|
|
29
29
|
if (rootDir) {
|
|
30
30
|
const pkgJson = await pkgTypes.readPackageJSON(void 0, { startingFrom: rootDir });
|
|
@@ -70,6 +70,7 @@ async function initSiteConfig(nuxt = kit.tryUseNuxt()) {
|
|
|
70
70
|
siteConfig.push({
|
|
71
71
|
_priority: -1,
|
|
72
72
|
_context: "runtimeConfig",
|
|
73
|
+
env: getRuntimeConfig("Env"),
|
|
73
74
|
url: getRuntimeConfig("Url"),
|
|
74
75
|
name: getRuntimeConfig("Name"),
|
|
75
76
|
description: getRuntimeConfig("Description"),
|
|
@@ -81,6 +82,7 @@ async function initSiteConfig(nuxt = kit.tryUseNuxt()) {
|
|
|
81
82
|
siteConfig.push({
|
|
82
83
|
_context: "env",
|
|
83
84
|
_priority: 0,
|
|
85
|
+
env: getEnv("Env"),
|
|
84
86
|
url: getEnv("Url"),
|
|
85
87
|
name: getEnv("Name"),
|
|
86
88
|
description: getEnv("Description"),
|
|
@@ -88,6 +90,14 @@ async function initSiteConfig(nuxt = kit.tryUseNuxt()) {
|
|
|
88
90
|
defaultLocale: getEnv("Language"),
|
|
89
91
|
indexable: getEnv("Indexable")
|
|
90
92
|
});
|
|
93
|
+
const curStack = siteConfig.get();
|
|
94
|
+
if (typeof curStack.indexable === "undefined") {
|
|
95
|
+
siteConfig.push({
|
|
96
|
+
_context: "computed-env",
|
|
97
|
+
_priority: 0,
|
|
98
|
+
indexable: curStack.env === "production"
|
|
99
|
+
});
|
|
100
|
+
}
|
|
91
101
|
nuxt._siteConfig = siteConfig;
|
|
92
102
|
return siteConfig;
|
|
93
103
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { tryUseNuxt, installModule, resolvePath, useLogger, useNuxt } from '@nuxt/kit';
|
|
2
2
|
import { readPackageJSON } from 'pkg-types';
|
|
3
3
|
import { createSiteConfigStack, resolveSitePath, fixSlashes } from 'site-config-stack';
|
|
4
|
-
import { process,
|
|
4
|
+
import { process, env, isDevelopment } from 'std-env';
|
|
5
5
|
import { withoutProtocol } from 'ufo';
|
|
6
6
|
|
|
7
7
|
async function initSiteConfig(nuxt = tryUseNuxt()) {
|
|
@@ -22,7 +22,7 @@ async function initSiteConfig(nuxt = tryUseNuxt()) {
|
|
|
22
22
|
_context: "system",
|
|
23
23
|
_priority: -15,
|
|
24
24
|
name: rootDir ? rootDir.split("/").pop() : void 0,
|
|
25
|
-
|
|
25
|
+
env: env.NODE_ENV
|
|
26
26
|
});
|
|
27
27
|
if (rootDir) {
|
|
28
28
|
const pkgJson = await readPackageJSON(void 0, { startingFrom: rootDir });
|
|
@@ -68,6 +68,7 @@ async function initSiteConfig(nuxt = tryUseNuxt()) {
|
|
|
68
68
|
siteConfig.push({
|
|
69
69
|
_priority: -1,
|
|
70
70
|
_context: "runtimeConfig",
|
|
71
|
+
env: getRuntimeConfig("Env"),
|
|
71
72
|
url: getRuntimeConfig("Url"),
|
|
72
73
|
name: getRuntimeConfig("Name"),
|
|
73
74
|
description: getRuntimeConfig("Description"),
|
|
@@ -79,6 +80,7 @@ async function initSiteConfig(nuxt = tryUseNuxt()) {
|
|
|
79
80
|
siteConfig.push({
|
|
80
81
|
_context: "env",
|
|
81
82
|
_priority: 0,
|
|
83
|
+
env: getEnv("Env"),
|
|
82
84
|
url: getEnv("Url"),
|
|
83
85
|
name: getEnv("Name"),
|
|
84
86
|
description: getEnv("Description"),
|
|
@@ -86,6 +88,14 @@ async function initSiteConfig(nuxt = tryUseNuxt()) {
|
|
|
86
88
|
defaultLocale: getEnv("Language"),
|
|
87
89
|
indexable: getEnv("Indexable")
|
|
88
90
|
});
|
|
91
|
+
const curStack = siteConfig.get();
|
|
92
|
+
if (typeof curStack.indexable === "undefined") {
|
|
93
|
+
siteConfig.push({
|
|
94
|
+
_context: "computed-env",
|
|
95
|
+
_priority: 0,
|
|
96
|
+
indexable: curStack.env === "production"
|
|
97
|
+
});
|
|
98
|
+
}
|
|
89
99
|
nuxt._siteConfig = siteConfig;
|
|
90
100
|
return siteConfig;
|
|
91
101
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-site-config-kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"description": "Shared site configuration build-time utilities for Nuxt 3 modules.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"pkg-types": "^1.0.3",
|
|
33
33
|
"std-env": "^3.4.3",
|
|
34
34
|
"ufo": "^1.3.1",
|
|
35
|
-
"site-config-stack": "1.
|
|
35
|
+
"site-config-stack": "1.5.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"lint": "eslint . --fix",
|