@nimpl/i18n 1.1.2 → 1.2.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/withI18n.js +3 -3
- package/package.json +1 -1
- package/withI18n.d.ts +1 -1
package/dist/withI18n.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const createCacheServer_1 = __importDefault(require("./configuration/createCacheServer"));
|
|
7
7
|
const PORT = "24";
|
|
8
8
|
let cacheSecret = process.env.I18N_CACHE_SECRET;
|
|
9
|
-
const withI18n = async (
|
|
10
|
-
if (!cacheSecret
|
|
9
|
+
const withI18n = async () => {
|
|
10
|
+
if (!cacheSecret) {
|
|
11
11
|
try {
|
|
12
12
|
const devResp = await fetch(`http://localhost:${PORT}/?type=dev`);
|
|
13
13
|
const data = await devResp.json();
|
|
@@ -19,7 +19,7 @@ const withI18n = async (phase) => {
|
|
|
19
19
|
//
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
if (
|
|
22
|
+
if (!cacheSecret) {
|
|
23
23
|
const { secret } = await (0, createCacheServer_1.default)(PORT);
|
|
24
24
|
cacheSecret = secret;
|
|
25
25
|
}
|
package/package.json
CHANGED
package/withI18n.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const withI18n: (
|
|
1
|
+
declare const withI18n: () => Promise<(nextConfig: any) => any>;
|
|
2
2
|
export default withI18n;
|