@intlify/unplugin-vue-i18n 0.12.0 → 0.12.2
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 +0 -2
- package/lib/index.cjs +20 -9
- package/lib/index.mjs +6 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -376,8 +376,6 @@ This plugin will automatically select and bundle `petite-vue-i18n` build accordi
|
|
|
376
376
|
|
|
377
377
|
If `false` is specified, Vue I18n (vue-i18n) package.json `module` field will be used.
|
|
378
378
|
|
|
379
|
-
**If you want to dynamically handle with locale mesages, such as fetch from back-end DB, set this option to `false`**.
|
|
380
|
-
|
|
381
379
|
For more details, See [here](#-automatic-bundling)
|
|
382
380
|
|
|
383
381
|
### `compositionOnly`
|
package/lib/index.cjs
CHANGED
|
@@ -15,6 +15,14 @@ const yaml = require('js-yaml');
|
|
|
15
15
|
const fs = require('fs');
|
|
16
16
|
const pc = require('picocolors');
|
|
17
17
|
|
|
18
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
19
|
+
|
|
20
|
+
const createDebug__default = /*#__PURE__*/_interopDefaultCompat(createDebug);
|
|
21
|
+
const fg__default = /*#__PURE__*/_interopDefaultCompat(fg);
|
|
22
|
+
const JSON5__default = /*#__PURE__*/_interopDefaultCompat(JSON5);
|
|
23
|
+
const yaml__default = /*#__PURE__*/_interopDefaultCompat(yaml);
|
|
24
|
+
const pc__default = /*#__PURE__*/_interopDefaultCompat(pc);
|
|
25
|
+
|
|
18
26
|
function parseVueRequest(id) {
|
|
19
27
|
const [filename, rawQuery] = id.split(`?`, 2);
|
|
20
28
|
const params = new URLSearchParams(rawQuery);
|
|
@@ -67,20 +75,20 @@ function convert(source, lang) {
|
|
|
67
75
|
switch (lang) {
|
|
68
76
|
case "yaml":
|
|
69
77
|
case "yml":
|
|
70
|
-
const data =
|
|
78
|
+
const data = yaml__default.load(source);
|
|
71
79
|
return JSON.stringify(data, void 0, " ");
|
|
72
80
|
case "json5":
|
|
73
|
-
return JSON.stringify(
|
|
81
|
+
return JSON.stringify(JSON5__default.parse(source));
|
|
74
82
|
default:
|
|
75
83
|
return source;
|
|
76
84
|
}
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
function warn(...args) {
|
|
80
|
-
console.warn(
|
|
88
|
+
console.warn(pc__default.yellow(pc__default.bold(`[unplugin-vue-i18n] `)), ...args);
|
|
81
89
|
}
|
|
82
90
|
function error(...args) {
|
|
83
|
-
console.error(
|
|
91
|
+
console.error(pc__default.red(pc__default.bold(`[unplugin-vue-i18n] `)), ...args);
|
|
84
92
|
}
|
|
85
93
|
async function getRaw(path) {
|
|
86
94
|
return fs.promises.readFile(path, { encoding: "utf-8" });
|
|
@@ -92,7 +100,7 @@ function raiseError(message) {
|
|
|
92
100
|
const INTLIFY_BUNDLE_IMPORT_ID = "@intlify/unplugin-vue-i18n/messages";
|
|
93
101
|
const INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID = "@intlify/vite-plugin-vue-i18n/messages";
|
|
94
102
|
const VIRTUAL_PREFIX = "\0";
|
|
95
|
-
const debug =
|
|
103
|
+
const debug = createDebug__default("unplugin-vue-i18n");
|
|
96
104
|
const installedPkg = bundleUtils.checkInstallPackage("@intlify/unplugin-vue-i18n", debug);
|
|
97
105
|
const installedVueI18nBridge = bundleUtils.checkVueI18nBridgeInstallPackage(debug);
|
|
98
106
|
const vueI18nVersion = bundleUtils.getVueI18nVersion(debug);
|
|
@@ -292,7 +300,8 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
292
300
|
return;
|
|
293
301
|
return {
|
|
294
302
|
code: generatedCode,
|
|
295
|
-
|
|
303
|
+
// prettier-ignore
|
|
304
|
+
map: jitCompilation ? { mappings: "" } : sourceMap ? map : { mappings: "" }
|
|
296
305
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
297
306
|
};
|
|
298
307
|
} else {
|
|
@@ -387,7 +396,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
387
396
|
let resourcePaths = [];
|
|
388
397
|
const includePaths = shared.isArray(include) ? include : [include];
|
|
389
398
|
for (const inc of includePaths) {
|
|
390
|
-
resourcePaths = [...resourcePaths, ...await
|
|
399
|
+
resourcePaths = [...resourcePaths, ...await fg__default(inc)];
|
|
391
400
|
}
|
|
392
401
|
resourcePaths = resourcePaths.filter(
|
|
393
402
|
(el, pos) => resourcePaths.indexOf(el) === pos
|
|
@@ -459,7 +468,8 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
459
468
|
return;
|
|
460
469
|
return {
|
|
461
470
|
code: generatedCode,
|
|
462
|
-
|
|
471
|
+
// prettier-ignore
|
|
472
|
+
map: jitCompilation ? { mappings: "" } : sourceMap ? map : { mappings: "" }
|
|
463
473
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
464
474
|
};
|
|
465
475
|
}
|
|
@@ -508,7 +518,8 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
508
518
|
return;
|
|
509
519
|
return {
|
|
510
520
|
code: generatedCode,
|
|
511
|
-
|
|
521
|
+
// prettier-ignore
|
|
522
|
+
map: jitCompilation ? { mappings: "" } : sourceMap ? map : { mappings: "" }
|
|
512
523
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
513
524
|
};
|
|
514
525
|
}
|
package/lib/index.mjs
CHANGED
|
@@ -288,7 +288,8 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
288
288
|
return;
|
|
289
289
|
return {
|
|
290
290
|
code: generatedCode,
|
|
291
|
-
|
|
291
|
+
// prettier-ignore
|
|
292
|
+
map: jitCompilation ? { mappings: "" } : sourceMap ? map : { mappings: "" }
|
|
292
293
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
293
294
|
};
|
|
294
295
|
} else {
|
|
@@ -455,7 +456,8 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
455
456
|
return;
|
|
456
457
|
return {
|
|
457
458
|
code: generatedCode,
|
|
458
|
-
|
|
459
|
+
// prettier-ignore
|
|
460
|
+
map: jitCompilation ? { mappings: "" } : sourceMap ? map : { mappings: "" }
|
|
459
461
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
460
462
|
};
|
|
461
463
|
}
|
|
@@ -504,7 +506,8 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
504
506
|
return;
|
|
505
507
|
return {
|
|
506
508
|
code: generatedCode,
|
|
507
|
-
|
|
509
|
+
// prettier-ignore
|
|
510
|
+
map: jitCompilation ? { mappings: "" } : sourceMap ? map : { mappings: "" }
|
|
508
511
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
509
512
|
};
|
|
510
513
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlify/unplugin-vue-i18n",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "unplugin for Vue I18n",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@intlify/bundle-utils": "^7.0.
|
|
30
|
-
"@intlify/shared": "9.3.0-beta.
|
|
29
|
+
"@intlify/bundle-utils": "^7.0.2",
|
|
30
|
+
"@intlify/shared": "9.3.0-beta.24",
|
|
31
31
|
"@rollup/pluginutils": "^5.0.2",
|
|
32
32
|
"@vue/compiler-sfc": "^3.2.47",
|
|
33
33
|
"debug": "^4.3.3",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"unplugin": "^1.1.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"unbuild": "^1.1
|
|
43
|
+
"unbuild": "^1.2.1"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">= 14.16"
|