@intlify/unplugin-vue-i18n 0.8.1 → 0.8.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 +1 -1
- package/lib/index.cjs +7 -15
- package/lib/types.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -228,7 +228,7 @@ If you want type definition of `@intlify/unplugin-vue-i18n/messages`, add `unplu
|
|
|
228
228
|
|
|
229
229
|
## 📦 Automatic bundling
|
|
230
230
|
### For Vue I18n
|
|
231
|
-
As noted [here](https://vue-i18n.intlify.dev/installation.html#explanation-of-different-builds), NPM provides many different builds of Vue I18n.
|
|
231
|
+
As noted [here](https://vue-i18n.intlify.dev/guide/installation.html#explanation-of-different-builds), NPM provides many different builds of Vue I18n.
|
|
232
232
|
|
|
233
233
|
This plugin will automatically select and bundle Vue I18n build according to the following behavior:
|
|
234
234
|
|
package/lib/index.cjs
CHANGED
|
@@ -15,14 +15,6 @@ const yaml = require('js-yaml');
|
|
|
15
15
|
const fs = require('fs');
|
|
16
16
|
const pc = require('picocolors');
|
|
17
17
|
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
|
|
19
|
-
|
|
20
|
-
const createDebug__default = /*#__PURE__*/_interopDefaultLegacy(createDebug);
|
|
21
|
-
const fg__default = /*#__PURE__*/_interopDefaultLegacy(fg);
|
|
22
|
-
const JSON5__default = /*#__PURE__*/_interopDefaultLegacy(JSON5);
|
|
23
|
-
const yaml__default = /*#__PURE__*/_interopDefaultLegacy(yaml);
|
|
24
|
-
const pc__default = /*#__PURE__*/_interopDefaultLegacy(pc);
|
|
25
|
-
|
|
26
18
|
function parseVueRequest(id) {
|
|
27
19
|
const [filename, rawQuery] = id.split(`?`, 2);
|
|
28
20
|
const params = new URLSearchParams(rawQuery);
|
|
@@ -75,20 +67,20 @@ function convert(source, lang) {
|
|
|
75
67
|
switch (lang) {
|
|
76
68
|
case "yaml":
|
|
77
69
|
case "yml":
|
|
78
|
-
const data =
|
|
70
|
+
const data = yaml.load(source);
|
|
79
71
|
return JSON.stringify(data, void 0, " ");
|
|
80
72
|
case "json5":
|
|
81
|
-
return JSON.stringify(
|
|
73
|
+
return JSON.stringify(JSON5.parse(source));
|
|
82
74
|
default:
|
|
83
75
|
return source;
|
|
84
76
|
}
|
|
85
77
|
}
|
|
86
78
|
|
|
87
79
|
function warn(...args) {
|
|
88
|
-
console.warn(
|
|
80
|
+
console.warn(pc.yellow(pc.bold(`[unplugin-vue-i18n] `)), ...args);
|
|
89
81
|
}
|
|
90
82
|
function error(...args) {
|
|
91
|
-
console.error(
|
|
83
|
+
console.error(pc.red(pc.bold(`[unplugin-vue-i18n] `)), ...args);
|
|
92
84
|
}
|
|
93
85
|
async function getRaw(path) {
|
|
94
86
|
return fs.promises.readFile(path, { encoding: "utf-8" });
|
|
@@ -100,7 +92,7 @@ function raiseError(message) {
|
|
|
100
92
|
const INTLIFY_BUNDLE_IMPORT_ID = "@intlify/unplugin-vue-i18n/messages";
|
|
101
93
|
const INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID = "@intlify/vite-plugin-vue-i18n/messages";
|
|
102
94
|
const VIRTUAL_PREFIX = "\0";
|
|
103
|
-
const debug =
|
|
95
|
+
const debug = createDebug("unplugin-vue-i18n");
|
|
104
96
|
const installedPkg = bundleUtils.checkInstallPackage("@intlify/unplugin-vue-i18n", debug);
|
|
105
97
|
const installedVueI18nBridge = bundleUtils.checkVueI18nBridgeInstallPackage(debug);
|
|
106
98
|
const vueI18nVersion = bundleUtils.getVueI18nVersion(debug);
|
|
@@ -317,7 +309,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
317
309
|
let resourcePaths = [];
|
|
318
310
|
const includePaths = shared.isArray(include) ? include : [include];
|
|
319
311
|
for (const inc of includePaths) {
|
|
320
|
-
resourcePaths = [...resourcePaths, ...await
|
|
312
|
+
resourcePaths = [...resourcePaths, ...await fg(inc)];
|
|
321
313
|
}
|
|
322
314
|
resourcePaths = resourcePaths.filter(
|
|
323
315
|
(el, pos) => resourcePaths.indexOf(el) === pos
|
|
@@ -587,5 +579,5 @@ function asVirtualId(id, framework = "vite") {
|
|
|
587
579
|
return framework === "vite" ? VIRTUAL_PREFIX + id : id;
|
|
588
580
|
}
|
|
589
581
|
|
|
590
|
-
exports
|
|
582
|
+
exports.default = unplugin;
|
|
591
583
|
exports.unplugin = unplugin;
|
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlify/unplugin-vue-i18n",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "unplugin for Vue I18n",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@intlify/bundle-utils": "^
|
|
29
|
+
"@intlify/bundle-utils": "^4.0.0",
|
|
30
30
|
"@intlify/shared": "next",
|
|
31
31
|
"@rollup/pluginutils": "^4.2.0",
|
|
32
32
|
"@vue/compiler-sfc": "^3.2.45",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"mlly": "^1.0.0",
|
|
44
|
-
"unbuild": "^0.
|
|
44
|
+
"unbuild": "^1.0.2"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">= 14.16"
|