@lingui/loader 4.3.0 → 4.4.1
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 +18 -1
- package/dist/index.mjs +18 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -11,10 +11,27 @@ const loader = async function(source) {
|
|
|
11
11
|
cwd: path.dirname(this.resourcePath)
|
|
12
12
|
});
|
|
13
13
|
const catalogRelativePath = path.relative(config.rootDir, this.resourcePath);
|
|
14
|
-
const
|
|
14
|
+
const fileCatalog = api.getCatalogForFile(
|
|
15
15
|
catalogRelativePath,
|
|
16
16
|
await api.getCatalogs(config)
|
|
17
17
|
);
|
|
18
|
+
if (!fileCatalog) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
`Requested resource ${catalogRelativePath} is not matched to any of your catalogs paths specified in "lingui.config".
|
|
21
|
+
|
|
22
|
+
Resource: ${this.resourcePath}
|
|
23
|
+
|
|
24
|
+
Your catalogs:
|
|
25
|
+
${config.catalogs.map((c) => c.path).join("\n")}
|
|
26
|
+
|
|
27
|
+
Working dir is:
|
|
28
|
+
${process.cwd()}
|
|
29
|
+
|
|
30
|
+
Please check that \`catalogs.path\` is filled properly.
|
|
31
|
+
`
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
const { locale, catalog } = fileCatalog;
|
|
18
35
|
const dependency = await api.getCatalogDependentFiles(catalog, locale);
|
|
19
36
|
dependency.forEach((file) => this.addDependency(file));
|
|
20
37
|
const messages = await catalog.getTranslations(locale, {
|
package/dist/index.mjs
CHANGED
|
@@ -9,10 +9,27 @@ const loader = async function(source) {
|
|
|
9
9
|
cwd: path.dirname(this.resourcePath)
|
|
10
10
|
});
|
|
11
11
|
const catalogRelativePath = path.relative(config.rootDir, this.resourcePath);
|
|
12
|
-
const
|
|
12
|
+
const fileCatalog = getCatalogForFile(
|
|
13
13
|
catalogRelativePath,
|
|
14
14
|
await getCatalogs(config)
|
|
15
15
|
);
|
|
16
|
+
if (!fileCatalog) {
|
|
17
|
+
throw new Error(
|
|
18
|
+
`Requested resource ${catalogRelativePath} is not matched to any of your catalogs paths specified in "lingui.config".
|
|
19
|
+
|
|
20
|
+
Resource: ${this.resourcePath}
|
|
21
|
+
|
|
22
|
+
Your catalogs:
|
|
23
|
+
${config.catalogs.map((c) => c.path).join("\n")}
|
|
24
|
+
|
|
25
|
+
Working dir is:
|
|
26
|
+
${process.cwd()}
|
|
27
|
+
|
|
28
|
+
Please check that \`catalogs.path\` is filled properly.
|
|
29
|
+
`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
const { locale, catalog } = fileCatalog;
|
|
16
33
|
const dependency = await getCatalogDependentFiles(catalog, locale);
|
|
17
34
|
dependency.forEach((file) => this.addDependency(file));
|
|
18
35
|
const messages = await catalog.getTranslations(locale, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingui/loader",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.1",
|
|
4
4
|
"description": "webpack loader for lingui message catalogs",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -43,16 +43,16 @@
|
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@babel/runtime": "^7.20.13",
|
|
46
|
-
"@lingui/cli": "4.
|
|
47
|
-
"@lingui/conf": "4.
|
|
46
|
+
"@lingui/cli": "4.4.1",
|
|
47
|
+
"@lingui/conf": "4.4.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@lingui/format-json": "4.
|
|
50
|
+
"@lingui/format-json": "4.4.1",
|
|
51
51
|
"unbuild": "^1.1.2",
|
|
52
52
|
"webpack": "^5.76.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"webpack": "^5.0.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "e7103c9f06a493e5871086e121f037309b0b742c"
|
|
58
58
|
}
|