@intlayer/dictionaries-entry 2.0.5 → 2.0.7

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.
Files changed (2) hide show
  1. package/package.json +3 -4
  2. package/src/index.ts +0 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/dictionaries-entry",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "private": false,
5
5
  "description": "IntLayer - Dictionaries Entry. This package only returns the dictionary entry path. For bundle configuration, this packages should be replaced by using an alias.",
6
6
  "keywords": [
@@ -27,7 +27,6 @@
27
27
  },
28
28
  "./package.json": "./package.json"
29
29
  },
30
- "main": "./src/index.ts",
31
30
  "module": "",
32
31
  "typesVersions": {
33
32
  "*": {
@@ -41,14 +40,14 @@
41
40
  "./package.json"
42
41
  ],
43
42
  "dependencies": {
44
- "@intlayer/config": "^2.0.5"
43
+ "@intlayer/config": "^2.0.7"
45
44
  },
46
45
  "devDependencies": {
47
46
  "@types/node": "^20.14.9",
48
47
  "rimraf": "5.0.5",
49
48
  "tsup": "^8.1.0",
50
49
  "typescript": "^5.5.2",
51
- "@intlayer/core": "^2.0.5",
50
+ "@intlayer/core": "^2.0.7",
52
51
  "@utils/eslint-config": "^1.0.4",
53
52
  "@utils/ts-config": "^1.0.4"
54
53
  },
package/src/index.ts DELETED
@@ -1,28 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- /**
3
- * @intlayer/dictionaries-entry is a package that only returns the dictionary entry path.
4
- * Using an external package allow to alias it in the bundle configuration (such as webpack).
5
- * The alias allow hot reload the app (such as nextjs) on any dictionary change.
6
- */
7
-
8
- import { existsSync } from 'fs';
9
- import { createRequire } from 'module';
10
- import { join } from 'path';
11
- import { getConfiguration } from '@intlayer/config';
12
- import type { Dictionary } from '@intlayer/core';
13
-
14
- const isESModule = typeof import.meta.url === 'string';
15
- let dictionaries = undefined;
16
-
17
- const requireFunction = isESModule ? createRequire(import.meta.url) : require;
18
-
19
- const { content } = getConfiguration();
20
- const dictionariesPath = join(content.mainDir, 'dictionaries.cjs');
21
-
22
- // Test if the dictionaries file exists
23
- if (existsSync(dictionariesPath)) {
24
- requireFunction(dictionariesPath);
25
- dictionaries = requireFunction(dictionariesPath);
26
- }
27
-
28
- export default (dictionaries ?? {}) as Record<string, Dictionary>;