@lingui/loader 3.15.0 → 3.16.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/CHANGELOG.md +357 -0
- package/build/LICENSE +21 -0
- package/{index.d.ts → build/index.d.ts} +0 -0
- package/{index.js → build/index.js} +7 -4
- package/{webpackLoader.js → build/webpackLoader.js} +20 -20
- package/package.json +15 -8
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
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.16.1](https://github.com/lingui/js-lingui/compare/v3.16.0...v3.16.1) (2023-01-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @lingui/loader
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.16.0](https://github.com/lingui/js-lingui/compare/v3.15.0...v3.16.0) (2023-01-18)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @lingui/loader
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [3.15.0](https://github.com/lingui/js-lingui/compare/v3.14.0...v3.15.0) (2022-11-07)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* Support GetText template files support during compile ([#1296](https://github.com/lingui/js-lingui/issues/1296)) ([5e43810](https://github.com/lingui/js-lingui/commit/5e43810c98a57ef5ada16f149cf761eab611b715))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [3.14.0](https://github.com/lingui/js-lingui/compare/v3.13.3...v3.14.0) (2022-06-22)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @lingui/loader
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [3.13.3](https://github.com/lingui/js-lingui/compare/v3.13.2...v3.13.3) (2022-04-24)
|
|
42
|
+
|
|
43
|
+
**Note:** Version bump only for package @lingui/loader
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## [3.13.2](https://github.com/lingui/js-lingui/compare/v3.13.1...v3.13.2) (2022-01-24)
|
|
50
|
+
|
|
51
|
+
**Note:** Version bump only for package @lingui/loader
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## [3.13.1](https://github.com/lingui/js-lingui/compare/v3.13.0...v3.13.1) (2022-01-21)
|
|
58
|
+
|
|
59
|
+
**Note:** Version bump only for package @lingui/loader
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
# [3.13.0](https://github.com/lingui/js-lingui/compare/v3.12.1...v3.13.0) (2021-11-26)
|
|
66
|
+
|
|
67
|
+
**Note:** Version bump only for package @lingui/loader
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## [3.12.1](https://github.com/lingui/js-lingui/compare/v3.12.0...v3.12.1) (2021-09-28)
|
|
74
|
+
|
|
75
|
+
**Note:** Version bump only for package @lingui/loader
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# [3.12.0](https://github.com/lingui/js-lingui/compare/v3.11.1...v3.12.0) (2021-09-28)
|
|
82
|
+
|
|
83
|
+
**Note:** Version bump only for package @lingui/loader
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## [3.11.1](https://github.com/lingui/js-lingui/compare/v3.11.0...v3.11.1) (2021-09-07)
|
|
90
|
+
|
|
91
|
+
**Note:** Version bump only for package @lingui/loader
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
# [3.11.0](https://github.com/lingui/js-lingui/compare/v3.10.4...v3.11.0) (2021-09-07)
|
|
98
|
+
|
|
99
|
+
**Note:** Version bump only for package @lingui/loader
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## [3.10.4](https://github.com/lingui/js-lingui/compare/v3.10.3...v3.10.4) (2021-06-16)
|
|
106
|
+
|
|
107
|
+
**Note:** Version bump only for package @lingui/loader
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
## [3.10.3](https://github.com/lingui/js-lingui/compare/v3.10.2...v3.10.3) (2021-06-14)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### Bug Fixes
|
|
117
|
+
|
|
118
|
+
* remoteLoader pure functional on browser env ([#1085](https://github.com/lingui/js-lingui/issues/1085)) ([85856ac](https://github.com/lingui/js-lingui/commit/85856acfa6b1375ef2c96ce0022ee7fe29b4449f))
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
## [3.10.2](https://github.com/lingui/js-lingui/compare/v3.10.1...v3.10.2) (2021-06-08)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### Bug Fixes
|
|
128
|
+
|
|
129
|
+
* remoteLoader should return an object instead of export ([d461695](https://github.com/lingui/js-lingui/commit/d46169598e4b43c5fb5cb686f9b1e8811292e9c6))
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
## [3.10.1](https://github.com/lingui/js-lingui/compare/v3.10.0...v3.10.1) (2021-06-08)
|
|
136
|
+
|
|
137
|
+
**Note:** Version bump only for package @lingui/loader
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
# [3.10.0](https://github.com/lingui/js-lingui/compare/v3.9.0...v3.10.0) (2021-06-08)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
### Features
|
|
147
|
+
|
|
148
|
+
* load remote catalogs with remoteLoader() ([#1080](https://github.com/lingui/js-lingui/issues/1080)) ([e73a4b3](https://github.com/lingui/js-lingui/commit/e73a4b34cf8d83a45044c220148761d79b4fd8a9))
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
# [3.9.0](https://github.com/lingui/js-lingui/compare/v3.8.10...v3.9.0) (2021-05-18)
|
|
155
|
+
|
|
156
|
+
**Note:** Version bump only for package @lingui/loader
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
## [3.8.10](https://github.com/lingui/js-lingui/compare/v3.8.9...v3.8.10) (2021-04-19)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
### Bug Fixes
|
|
166
|
+
|
|
167
|
+
* loader works smoothly on webpack 5 & 4 ([#1046](https://github.com/lingui/js-lingui/issues/1046)) ([78ad09f](https://github.com/lingui/js-lingui/commit/78ad09fc88e8ec07daefb455457e778471977f2f))
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
## [3.8.9](https://github.com/lingui/js-lingui/compare/v3.8.8...v3.8.9) (2021-04-09)
|
|
174
|
+
|
|
175
|
+
**Note:** Version bump only for package @lingui/loader
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
## [3.8.8](https://github.com/lingui/js-lingui/compare/v3.8.7...v3.8.8) (2021-04-09)
|
|
182
|
+
|
|
183
|
+
**Note:** Version bump only for package @lingui/loader
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
## [3.8.7](https://github.com/lingui/js-lingui/compare/v3.8.6...v3.8.7) (2021-04-09)
|
|
190
|
+
|
|
191
|
+
**Note:** Version bump only for package @lingui/loader
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
## [3.8.6](https://github.com/lingui/js-lingui/compare/v3.8.5...v3.8.6) (2021-04-08)
|
|
198
|
+
|
|
199
|
+
**Note:** Version bump only for package @lingui/loader
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
## [3.8.5](https://github.com/lingui/js-lingui/compare/v3.8.4...v3.8.5) (2021-04-08)
|
|
206
|
+
|
|
207
|
+
**Note:** Version bump only for package @lingui/loader
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
## [3.8.4](https://github.com/lingui/js-lingui/compare/v3.8.3...v3.8.4) (2021-04-08)
|
|
214
|
+
|
|
215
|
+
**Note:** Version bump only for package @lingui/loader
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
## [3.8.3](https://github.com/lingui/js-lingui/compare/v3.8.2...v3.8.3) (2021-04-05)
|
|
222
|
+
|
|
223
|
+
**Note:** Version bump only for package @lingui/loader
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
## [3.8.2](https://github.com/lingui/js-lingui/compare/v3.8.1...v3.8.2) (2021-03-31)
|
|
230
|
+
|
|
231
|
+
**Note:** Version bump only for package @lingui/loader
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
## [3.8.1](https://github.com/lingui/js-lingui/compare/v3.8.0...v3.8.1) (2021-03-23)
|
|
238
|
+
|
|
239
|
+
**Note:** Version bump only for package @lingui/loader
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
# [3.8.0](https://github.com/lingui/js-lingui/compare/v3.7.2...v3.8.0) (2021-03-23)
|
|
246
|
+
|
|
247
|
+
**Note:** Version bump only for package @lingui/loader
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
## [3.7.2](https://github.com/lingui/js-lingui/compare/v3.7.1...v3.7.2) (2021-03-14)
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
### Bug Fixes
|
|
257
|
+
|
|
258
|
+
* webpack 5 issue with jest @lingui/loader [#999](https://github.com/lingui/js-lingui/issues/999) ([9e68a8d](https://github.com/lingui/js-lingui/commit/9e68a8d1e6f3565f724dd027b165e85b1d891c92))
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
## [3.7.1](https://github.com/lingui/js-lingui/compare/v3.7.0...v3.7.1) (2021-03-07)
|
|
265
|
+
|
|
266
|
+
**Note:** Version bump only for package @lingui/loader
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
# [3.7.0](https://github.com/lingui/js-lingui/compare/v3.6.0...v3.7.0) (2021-03-04)
|
|
273
|
+
|
|
274
|
+
**Note:** Version bump only for package @lingui/loader
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
# [3.6.0](https://github.com/lingui/js-lingui/compare/v3.5.1...v3.6.0) (2021-02-23)
|
|
281
|
+
|
|
282
|
+
**Note:** Version bump only for package @lingui/loader
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
## [3.5.1](https://github.com/lingui/js-lingui/compare/v3.5.0...v3.5.1) (2021-02-09)
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
### Bug Fixes
|
|
292
|
+
|
|
293
|
+
* **@lingui/loader:** accept webpack 5.x as a peer dependency ([#971](https://github.com/lingui/js-lingui/issues/971)) ([b9683cc](https://github.com/lingui/js-lingui/commit/b9683cc3f1274efab805d6143398d78fbb3310c5))
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
# [3.5.0](https://github.com/lingui/js-lingui/compare/v3.4.0...v3.5.0) (2021-02-02)
|
|
300
|
+
|
|
301
|
+
**Note:** Version bump only for package @lingui/loader
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
# [3.4.0](https://github.com/lingui/js-lingui/compare/v3.3.0...v3.4.0) (2021-01-13)
|
|
308
|
+
|
|
309
|
+
**Note:** Version bump only for package @lingui/loader
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
# [3.3.0](https://github.com/lingui/js-lingui/compare/v3.2.3...v3.3.0) (2020-12-08)
|
|
316
|
+
|
|
317
|
+
**Note:** Version bump only for package @lingui/loader
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
## [3.2.3](https://github.com/lingui/js-lingui/compare/v3.2.2...v3.2.3) (2020-11-22)
|
|
324
|
+
|
|
325
|
+
**Note:** Version bump only for package @lingui/loader
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
## [3.2.2](https://github.com/lingui/js-lingui/compare/v3.2.1...v3.2.2) (2020-11-20)
|
|
332
|
+
|
|
333
|
+
**Note:** Version bump only for package @lingui/loader
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
# [3.2.0](https://github.com/lingui/js-lingui/compare/v3.1.0...v3.2.0) (2020-11-12)
|
|
340
|
+
|
|
341
|
+
**Note:** Version bump only for package @lingui/loader
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
# [3.1.0](https://github.com/lingui/js-lingui/compare/v3.0.3...v3.1.0) (2020-11-10)
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
### Bug Fixes
|
|
351
|
+
|
|
352
|
+
* mandatory ext on @lingui/loader ([#831](https://github.com/lingui/js-lingui/issues/831)) ([8979aaf](https://github.com/lingui/js-lingui/commit/8979aaf81e5f839a8406d3ac7516205113944c39))
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
### Features
|
|
356
|
+
|
|
357
|
+
* use fallback locales from cldr ([#820](https://github.com/lingui/js-lingui/issues/820)) ([2d9e124](https://github.com/lingui/js-lingui/commit/2d9e124b91f1ba7a65e9f997a3ba952679c6c23a))
|
package/build/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Tomáš Ehrlich
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
File without changes
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.remoteLoader = remoteLoader;
|
|
9
7
|
Object.defineProperty(exports, "default", {
|
|
10
8
|
enumerable: true,
|
|
11
|
-
get: function
|
|
9
|
+
get: function () {
|
|
12
10
|
return _webpackLoader.default;
|
|
13
11
|
}
|
|
14
12
|
});
|
|
15
13
|
|
|
16
14
|
var _webpackLoader = _interopRequireDefault(require("./webpackLoader"));
|
|
17
15
|
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
18
|
function remoteLoader() {
|
|
19
|
-
console.error(
|
|
19
|
+
console.error(`
|
|
20
|
+
DEPRECATED: { remoteLoader } from "@lingui/loader"
|
|
21
|
+
Use instead: { remoteLoader } from "@lingui/remote-loader"
|
|
22
|
+
`);
|
|
20
23
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -15,11 +13,13 @@ var _api = require("@lingui/cli/api");
|
|
|
15
13
|
|
|
16
14
|
var _loaderUtils = _interopRequireDefault(require("loader-utils"));
|
|
17
15
|
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
18
|
// Check if webpack 5
|
|
19
|
-
|
|
19
|
+
const isWebpack5 = parseInt(require("webpack").version) === 5; // Check if JavascriptParser and JavascriptGenerator exists -> Webpack 4
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
let JavascriptParser;
|
|
22
|
+
let JavascriptGenerator;
|
|
23
23
|
|
|
24
24
|
try {
|
|
25
25
|
JavascriptParser = require("webpack/lib/Parser");
|
|
@@ -30,10 +30,10 @@ try {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
const requiredType = "javascript/auto";
|
|
34
34
|
|
|
35
35
|
function _default(source) {
|
|
36
|
-
|
|
36
|
+
const options = _loaderUtils.default.getOptions(this) || {};
|
|
37
37
|
|
|
38
38
|
if (!isWebpack5 && JavascriptParser && JavascriptGenerator) {
|
|
39
39
|
// Webpack 4 uses json-loader automatically, which breaks this loader because it
|
|
@@ -45,30 +45,30 @@ function _default(source) {
|
|
|
45
45
|
this._module.generator = new JavascriptGenerator();
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
const config = (0, _conf.getConfig)({
|
|
49
49
|
configPath: options.config,
|
|
50
50
|
cwd: _path.default.dirname(this.resourcePath)
|
|
51
51
|
});
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const EMPTY_EXT = /\.[0-9a-z]+$/.test(this.resourcePath);
|
|
53
|
+
const JS_EXT = /\.js+$/.test(this.resourcePath);
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
const catalogRelativePath = _path.default.relative(config.rootDir, this.resourcePath);
|
|
56
56
|
|
|
57
57
|
if (!EMPTY_EXT || JS_EXT) {
|
|
58
|
-
|
|
58
|
+
const formats = {
|
|
59
59
|
minimal: ".json",
|
|
60
60
|
po: ".po",
|
|
61
61
|
lingui: ".json"
|
|
62
62
|
}; // we replace the .js, because webpack appends automatically the .js on imports without extension
|
|
63
63
|
|
|
64
|
-
throw new Error(
|
|
64
|
+
throw new Error(`File extension is mandatory, for ex: import("@lingui/loader!./${catalogRelativePath.replace(".js", formats[config.format])}")`);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
const {
|
|
68
|
+
locale,
|
|
69
|
+
catalog
|
|
70
|
+
} = (0, _api.getCatalogForFile)(catalogRelativePath, (0, _api.getCatalogs)(config));
|
|
71
|
+
const messages = catalog.getTranslations(locale, {
|
|
72
72
|
fallbackLocales: config.fallbackLocales,
|
|
73
73
|
sourceLocale: config.sourceLocale
|
|
74
74
|
}); // In production we don't want untranslated strings. It's better to use message
|
|
@@ -77,9 +77,9 @@ function _default(source) {
|
|
|
77
77
|
// of I18nProvider (React) or setupI18n (core) and therefore we need to get
|
|
78
78
|
// empty translations if missing.
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
const strict = process.env.NODE_ENV !== "production";
|
|
81
81
|
return (0, _api.createCompiledCatalog)(locale, messages, {
|
|
82
|
-
strict
|
|
82
|
+
strict,
|
|
83
83
|
namespace: config.compileNamespace,
|
|
84
84
|
pseudoLocale: config.pseudoLocale
|
|
85
85
|
});
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingui/loader",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.1",
|
|
4
4
|
"description": "webpack loader for lingui message catalogs",
|
|
5
|
-
"types": "index.d.ts",
|
|
6
|
-
"main": "index.js",
|
|
5
|
+
"types": "./build/index.d.ts",
|
|
6
|
+
"main": "./build/index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Tomáš Ehrlich",
|
|
9
9
|
"email": "tomas.ehrlich@gmail.com"
|
|
@@ -27,18 +27,25 @@
|
|
|
27
27
|
"url": "https://github.com/lingui/js-lingui/issues"
|
|
28
28
|
},
|
|
29
29
|
"engines": {
|
|
30
|
-
"node": ">=
|
|
30
|
+
"node": ">=14.0.0"
|
|
31
31
|
},
|
|
32
|
+
"files": [
|
|
33
|
+
"LICENSE",
|
|
34
|
+
"README.md",
|
|
35
|
+
"build/"
|
|
36
|
+
],
|
|
32
37
|
"dependencies": {
|
|
33
38
|
"@babel/runtime": "^7.11.2",
|
|
34
|
-
"@lingui/cli": "
|
|
35
|
-
"@lingui/conf": "
|
|
39
|
+
"@lingui/cli": "3.16.1",
|
|
40
|
+
"@lingui/conf": "3.16.1",
|
|
36
41
|
"loader-utils": "^2.0.0"
|
|
37
42
|
},
|
|
38
43
|
"devDependencies": {
|
|
39
|
-
"memory-fs": "^0.5.0"
|
|
44
|
+
"memory-fs": "^0.5.0",
|
|
45
|
+
"webpack": "^4.44.2"
|
|
40
46
|
},
|
|
41
47
|
"peerDependencies": {
|
|
42
48
|
"webpack": "^4.0.0 || ^5.0.0"
|
|
43
|
-
}
|
|
49
|
+
},
|
|
50
|
+
"gitHead": "bae762a1ef15d0a4d883bc8c1837603b4e79175e"
|
|
44
51
|
}
|