@lingui/vite-plugin 3.17.1 → 4.0.0-next.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/README.md +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.js +11 -8
- package/build/index.js.map +1 -1
- package/package.json +5 -5
- package/CHANGELOG.md +0 -19
package/README.md
CHANGED
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.lingui = void 0;
|
|
6
7
|
const conf_1 = require("@lingui/conf");
|
|
7
8
|
const api_1 = require("@lingui/cli/api");
|
|
8
9
|
const path_1 = __importDefault(require("path"));
|
|
@@ -11,19 +12,20 @@ function lingui(linguiConfig = {}) {
|
|
|
11
12
|
const config = (0, conf_1.getConfig)(linguiConfig);
|
|
12
13
|
return {
|
|
13
14
|
name: "vite-plugin-lingui",
|
|
15
|
+
config: (config) => {
|
|
16
|
+
// https://github.com/lingui/js-lingui/issues/1464
|
|
17
|
+
config.optimizeDeps.exclude = config.optimizeDeps.exclude || [];
|
|
18
|
+
config.optimizeDeps.exclude.push("@lingui/macro");
|
|
19
|
+
},
|
|
14
20
|
transform(src, id) {
|
|
15
21
|
if (fileRegex.test(id)) {
|
|
16
22
|
const catalogRelativePath = path_1.default.relative(config.rootDir, id);
|
|
17
23
|
const fileCatalog = (0, api_1.getCatalogForFile)(catalogRelativePath, (0, api_1.getCatalogs)(config));
|
|
18
24
|
const { locale, catalog } = fileCatalog;
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
sourceLocale: config.sourceLocale,
|
|
24
|
-
});
|
|
25
|
-
return acc;
|
|
26
|
-
}, {});
|
|
25
|
+
const messages = catalog.getTranslations(locale, {
|
|
26
|
+
fallbackLocales: config.fallbackLocales,
|
|
27
|
+
sourceLocale: config.sourceLocale,
|
|
28
|
+
});
|
|
27
29
|
const compiled = (0, api_1.createCompiledCatalog)(locale, messages, {
|
|
28
30
|
strict: false,
|
|
29
31
|
namespace: "es",
|
|
@@ -37,5 +39,6 @@ function lingui(linguiConfig = {}) {
|
|
|
37
39
|
},
|
|
38
40
|
};
|
|
39
41
|
}
|
|
42
|
+
exports.lingui = lingui;
|
|
40
43
|
exports.default = lingui;
|
|
41
44
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAwC;AACxC,yCAIwB;AACxB,gDAAuB;AAGvB,MAAM,SAAS,GAAG,SAAS,CAAA;AAQ3B,SAAgB,MAAM,CAAC,eAAiC,EAAE;IACxD,MAAM,MAAM,GAAG,IAAA,gBAAS,EAAC,YAAY,CAAC,CAAA;IAEtC,OAAO;QACL,IAAI,EAAE,oBAAoB;QAE1B,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;YACjB,kDAAkD;YAClD,MAAM,CAAC,YAAY,CAAC,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,IAAI,EAAE,CAAA;YAC/D,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QACnD,CAAC;QAED,SAAS,CAAC,GAAG,EAAE,EAAE;YACf,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;gBACtB,MAAM,mBAAmB,GAAG,cAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;gBAE7D,MAAM,WAAW,GAAG,IAAA,uBAAiB,EACnC,mBAAmB,EACnB,IAAA,iBAAW,EAAC,MAAM,CAAC,CACpB,CAAA;gBAED,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,WAAW,CAAA;gBAEvC,MAAM,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE;oBAC/C,eAAe,EAAE,MAAM,CAAC,eAAe;oBACvC,YAAY,EAAE,MAAM,CAAC,YAAY;iBAClC,CAAC,CAAA;gBAEF,MAAM,QAAQ,GAAG,IAAA,2BAAqB,EAAC,MAAM,EAAE,QAAQ,EAAE;oBACvD,MAAM,EAAE,KAAK;oBACb,SAAS,EAAE,IAAI;oBACf,YAAY,EAAE,MAAM,CAAC,YAAY;iBAClC,CAAC,CAAA;gBAEF,OAAO;oBACL,IAAI,EAAE,QAAQ;oBACd,GAAG,EAAE,IAAI,EAAE,kCAAkC;iBAC9C,CAAA;aACF;QACH,CAAC;KACF,CAAA;AACH,CAAC;AAzCD,wBAyCC;AAED,kBAAe,MAAM,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingui/vite-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-next.0",
|
|
4
4
|
"description": "Vite plugin for Lingui message catalogs",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"url": "https://github.com/lingui/js-lingui/issues"
|
|
28
28
|
},
|
|
29
29
|
"engines": {
|
|
30
|
-
"node": ">=
|
|
30
|
+
"node": ">=16.0.0"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"LICENSE",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"build/"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@lingui/cli": "
|
|
39
|
-
"@lingui/conf": "
|
|
38
|
+
"@lingui/cli": "^4.0.0-next.0",
|
|
39
|
+
"@lingui/conf": "^4.0.0-next.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"vite": "3.2.4"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "637f5cf6beda9d4ebce4e15cd9fdaa23e404b660"
|
|
45
45
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [3.17.1](https://github.com/lingui/js-lingui/compare/v3.17.0...v3.17.1) (2023-02-07)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @lingui/vite-plugin
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# [3.17.0](https://github.com/lingui/js-lingui/compare/v3.16.1...v3.17.0) (2023-02-01)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
### Features
|
|
18
|
-
|
|
19
|
-
* implement @lingui/vite-plugin ([#1306](https://github.com/lingui/js-lingui/issues/1306)) ([db5d3c3](https://github.com/lingui/js-lingui/commit/db5d3c309041202014d98b71894b473c587f643d))
|