next-translate-plugin 2.0.2 → 2.0.4
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/lib/cjs/index.js +1 -2
- package/lib/esm/index.js +2 -3
- package/package.json +2 -2
package/lib/cjs/index.js
CHANGED
|
@@ -58,13 +58,11 @@ function nextTranslate(nextConfig) {
|
|
|
58
58
|
localeDetection: localeDetection,
|
|
59
59
|
} });
|
|
60
60
|
var hasGetInitialPropsOnAppJs = false;
|
|
61
|
-
var isAppDirNext13 = false;
|
|
62
61
|
if (!pagesInDir) {
|
|
63
62
|
for (var _i = 0, possiblePageDirs_1 = possiblePageDirs; _i < possiblePageDirs_1.length; _i++) {
|
|
64
63
|
var possiblePageDir = possiblePageDirs_1[_i];
|
|
65
64
|
if (fs_1.default.existsSync(path_1.default.join(dir, possiblePageDir))) {
|
|
66
65
|
pagesInDir = possiblePageDir;
|
|
67
|
-
isAppDirNext13 = appDirNext13.includes(possiblePageDir);
|
|
68
66
|
break;
|
|
69
67
|
}
|
|
70
68
|
}
|
|
@@ -72,6 +70,7 @@ function nextTranslate(nextConfig) {
|
|
|
72
70
|
if (!pagesInDir || !fs_1.default.existsSync(path_1.default.join(dir, pagesInDir))) {
|
|
73
71
|
return nextConfigWithI18n;
|
|
74
72
|
}
|
|
73
|
+
var isAppDirNext13 = appDirNext13.includes(pagesInDir);
|
|
75
74
|
var pagesPath = path_1.default.join(dir, pagesInDir);
|
|
76
75
|
var app = fs_1.default.readdirSync(pagesPath).find(function (page) { return page.startsWith('_app.'); });
|
|
77
76
|
if (app) {
|
package/lib/esm/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
31
31
|
};
|
|
32
32
|
import fs from 'fs';
|
|
33
33
|
import path from 'path';
|
|
34
|
-
import {
|
|
34
|
+
import { getDefaultExport, hasHOC, hasStaticName, parseFile } from './utils';
|
|
35
35
|
var test = /\.(tsx|ts|js|mjs|jsx)$/;
|
|
36
36
|
var appDirNext13 = ['app', 'src/app'];
|
|
37
37
|
var possiblePageDirs = __spreadArray([
|
|
@@ -53,13 +53,11 @@ function nextTranslate(nextConfig) {
|
|
|
53
53
|
localeDetection: localeDetection,
|
|
54
54
|
} });
|
|
55
55
|
var hasGetInitialPropsOnAppJs = false;
|
|
56
|
-
var isAppDirNext13 = false;
|
|
57
56
|
if (!pagesInDir) {
|
|
58
57
|
for (var _i = 0, possiblePageDirs_1 = possiblePageDirs; _i < possiblePageDirs_1.length; _i++) {
|
|
59
58
|
var possiblePageDir = possiblePageDirs_1[_i];
|
|
60
59
|
if (fs.existsSync(path.join(dir, possiblePageDir))) {
|
|
61
60
|
pagesInDir = possiblePageDir;
|
|
62
|
-
isAppDirNext13 = appDirNext13.includes(possiblePageDir);
|
|
63
61
|
break;
|
|
64
62
|
}
|
|
65
63
|
}
|
|
@@ -67,6 +65,7 @@ function nextTranslate(nextConfig) {
|
|
|
67
65
|
if (!pagesInDir || !fs.existsSync(path.join(dir, pagesInDir))) {
|
|
68
66
|
return nextConfigWithI18n;
|
|
69
67
|
}
|
|
68
|
+
var isAppDirNext13 = appDirNext13.includes(pagesInDir);
|
|
70
69
|
var pagesPath = path.join(dir, pagesInDir);
|
|
71
70
|
var app = fs.readdirSync(pagesPath).find(function (page) { return page.startsWith('_app.'); });
|
|
72
71
|
if (app) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-translate-plugin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Tiny and powerful i18n plugin to translate your Next.js pages.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -104,4 +104,4 @@
|
|
|
104
104
|
"^.+\\.(j|t)sx?$": "babel-jest"
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
}
|
|
107
|
+
}
|