next-translate-plugin 2.0.3 → 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 CHANGED
@@ -39,12 +39,12 @@ var path_1 = __importDefault(require("path"));
39
39
  var utils_1 = require("./utils");
40
40
  var test = /\.(tsx|ts|js|mjs|jsx)$/;
41
41
  var appDirNext13 = ['app', 'src/app'];
42
- var possiblePageDirs = __spreadArray(__spreadArray([], appDirNext13, true), [
42
+ var possiblePageDirs = __spreadArray([
43
43
  'pages',
44
44
  'src/pages',
45
45
  'app/pages',
46
- 'integrations/pages',
47
- ], false);
46
+ 'integrations/pages'
47
+ ], appDirNext13, true);
48
48
  function nextTranslate(nextConfig) {
49
49
  if (nextConfig === void 0) { nextConfig = {}; }
50
50
  var basePath = pkgDir();
@@ -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,15 +31,15 @@ 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 { parseFile, getDefaultExport, hasStaticName, hasHOC } from './utils';
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
- var possiblePageDirs = __spreadArray(__spreadArray([], appDirNext13, true), [
37
+ var possiblePageDirs = __spreadArray([
38
38
  'pages',
39
39
  'src/pages',
40
40
  'app/pages',
41
- 'integrations/pages',
42
- ], false);
41
+ 'integrations/pages'
42
+ ], appDirNext13, true);
43
43
  function nextTranslate(nextConfig) {
44
44
  if (nextConfig === void 0) { nextConfig = {}; }
45
45
  var basePath = pkgDir();
@@ -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",
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": [