@intlify/unplugin-vue-i18n 0.6.2 → 0.7.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/README.md +3 -1
- package/lib/index.cjs +15 -1
- package/lib/index.mjs +15 -1
- package/package.json +1 -1
- package/CHANGELOG.md +0 -112
package/README.md
CHANGED
|
@@ -252,7 +252,7 @@ This plugin will automatically select and bundle `petite-vue-i18n` build accordi
|
|
|
252
252
|
- **Type:** `string | string[] | undefined`
|
|
253
253
|
- **Default:** `undefined`
|
|
254
254
|
|
|
255
|
-
A [
|
|
255
|
+
A [picomatch](https://github.com/micromatch/picomatch) pattern, or array of patterns, you can specify a path to pre-compile i18n resources files. The extensions of i18n resources to be precompiled are as follows:
|
|
256
256
|
|
|
257
257
|
```
|
|
258
258
|
- json
|
|
@@ -263,6 +263,8 @@ This plugin will automatically select and bundle `petite-vue-i18n` build accordi
|
|
|
263
263
|
|
|
264
264
|
Note `json` resources matches this option, it will be handled **before the internal json plugin of bundler, and will not be processed afterwards**, else the option doesn't match, the bundler side will handle.
|
|
265
265
|
|
|
266
|
+
If nothing is specified for this option, i.e. `undefined`, nothing is done to the resource in the above format.
|
|
267
|
+
|
|
266
268
|
### `runtimeOnly`
|
|
267
269
|
|
|
268
270
|
- **Type:** `boolean`
|
package/lib/index.cjs
CHANGED
|
@@ -109,14 +109,17 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
109
109
|
raiseError(`This plugin is supported 'vite' and 'webpack' only`);
|
|
110
110
|
}
|
|
111
111
|
let include = options.include;
|
|
112
|
+
let exclude = null;
|
|
112
113
|
if (include) {
|
|
113
114
|
if (shared.isArray(include)) {
|
|
114
115
|
include = include.map((item) => pathe.normalize(item));
|
|
115
116
|
} else if (shared.isString(include)) {
|
|
116
117
|
include = pathe.normalize(include);
|
|
117
118
|
}
|
|
119
|
+
} else {
|
|
120
|
+
exclude = "**/**";
|
|
118
121
|
}
|
|
119
|
-
const filter = pluginutils.createFilter(include);
|
|
122
|
+
const filter = pluginutils.createFilter(include, exclude);
|
|
120
123
|
const forceStringify = !!options.forceStringify;
|
|
121
124
|
const defaultSFCLang = shared.isString(options.defaultSFCLang) ? options.defaultSFCLang : "json";
|
|
122
125
|
const globalSFCScope = !!options.globalSFCScope;
|
|
@@ -203,6 +206,17 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
203
206
|
return orgTransform.apply(this, [code, id]);
|
|
204
207
|
};
|
|
205
208
|
}
|
|
209
|
+
},
|
|
210
|
+
async handleHotUpdate({ file, server }) {
|
|
211
|
+
if (/\.(json5?|ya?ml)$/.test(file)) {
|
|
212
|
+
const module = server.moduleGraph.getModuleById(
|
|
213
|
+
asVirtualId(INTLIFY_BUNDLE_IMPORT_ID, meta.framework)
|
|
214
|
+
);
|
|
215
|
+
if (module) {
|
|
216
|
+
server.moduleGraph.invalidateModule(module);
|
|
217
|
+
return [module];
|
|
218
|
+
}
|
|
219
|
+
}
|
|
206
220
|
}
|
|
207
221
|
},
|
|
208
222
|
webpack(compiler) {
|
package/lib/index.mjs
CHANGED
|
@@ -97,14 +97,17 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
97
97
|
raiseError(`This plugin is supported 'vite' and 'webpack' only`);
|
|
98
98
|
}
|
|
99
99
|
let include = options.include;
|
|
100
|
+
let exclude = null;
|
|
100
101
|
if (include) {
|
|
101
102
|
if (isArray(include)) {
|
|
102
103
|
include = include.map((item) => normalize(item));
|
|
103
104
|
} else if (isString(include)) {
|
|
104
105
|
include = normalize(include);
|
|
105
106
|
}
|
|
107
|
+
} else {
|
|
108
|
+
exclude = "**/**";
|
|
106
109
|
}
|
|
107
|
-
const filter = createFilter(include);
|
|
110
|
+
const filter = createFilter(include, exclude);
|
|
108
111
|
const forceStringify = !!options.forceStringify;
|
|
109
112
|
const defaultSFCLang = isString(options.defaultSFCLang) ? options.defaultSFCLang : "json";
|
|
110
113
|
const globalSFCScope = !!options.globalSFCScope;
|
|
@@ -191,6 +194,17 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
191
194
|
return orgTransform.apply(this, [code, id]);
|
|
192
195
|
};
|
|
193
196
|
}
|
|
197
|
+
},
|
|
198
|
+
async handleHotUpdate({ file, server }) {
|
|
199
|
+
if (/\.(json5?|ya?ml)$/.test(file)) {
|
|
200
|
+
const module = server.moduleGraph.getModuleById(
|
|
201
|
+
asVirtualId(INTLIFY_BUNDLE_IMPORT_ID, meta.framework)
|
|
202
|
+
);
|
|
203
|
+
if (module) {
|
|
204
|
+
server.moduleGraph.invalidateModule(module);
|
|
205
|
+
return [module];
|
|
206
|
+
}
|
|
207
|
+
}
|
|
194
208
|
}
|
|
195
209
|
},
|
|
196
210
|
webpack(compiler) {
|
package/package.json
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
## @intlify/unplugin-vue-i18n@0.6.2 (2022-09-27)
|
|
3
|
-
|
|
4
|
-
#### :bug: Bug Fixes
|
|
5
|
-
* [#187](https://github.com/intlify/bundle-tools/pull/187) fix(unplugin-vue-i18n): cannot set vue-i18n-bridge dist path ([@kazupon](https://github.com/kazupon))
|
|
6
|
-
|
|
7
|
-
#### Committers: 1
|
|
8
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## @intlify/unplugin-vue-i18n@0.6.1 (2022-09-26)
|
|
12
|
-
|
|
13
|
-
#### :zap: Improvement Features
|
|
14
|
-
* [#184](https://github.com/intlify/bundle-tools/pull/184) fix(unplugin-vue-i18n): port vue-i18n-bridge module detecting from vite-plugin-vue-i18n ([@kazupon](https://github.com/kazupon))
|
|
15
|
-
|
|
16
|
-
#### Committers: 1
|
|
17
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## @intlify/unplugin-vue-i18n@0.6.0 (2022-09-19)
|
|
21
|
-
|
|
22
|
-
#### :bug: Bug Fixes
|
|
23
|
-
* [#180](https://github.com/intlify/bundle-tools/pull/180) fix(unplugin-vue-i18n): improve compilation error handling ([@kazupon](https://github.com/kazupon))
|
|
24
|
-
|
|
25
|
-
#### Committers: 1
|
|
26
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## @intlify/unplugin-vue-i18n@0.5.0 (2022-07-26)
|
|
30
|
-
|
|
31
|
-
#### :star: Features
|
|
32
|
-
* [#156](https://github.com/intlify/bundle-tools/pull/156) feat(unplugin-vue-i18n): support petite-vue-i18n and useVueI18nImportName option ([@kazupon](https://github.com/kazupon))
|
|
33
|
-
|
|
34
|
-
#### :zap: Improvement Features
|
|
35
|
-
* [#155](https://github.com/intlify/bundle-tools/pull/155) fix(unplugin-vue-i18n): improve wrong virtual module implementation ([@kazupon](https://github.com/kazupon))
|
|
36
|
-
* [#154](https://github.com/intlify/bundle-tools/pull/154) fix(unplugin-vue-i18n): support unplugin v0.8 ([@kazupon](https://github.com/kazupon))
|
|
37
|
-
|
|
38
|
-
#### Committers: 1
|
|
39
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## @intlify/unplugin-vue-i18n@0.4.0 (2022-07-07)
|
|
43
|
-
|
|
44
|
-
#### :star: Features
|
|
45
|
-
* [#138](https://github.com/intlify/bundle-tools/pull/138) feat(unplugin-vue-i18n): support esm options for bridge ([@kazupon](https://github.com/kazupon))
|
|
46
|
-
|
|
47
|
-
#### Committers: 1
|
|
48
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
## @intlify/unplugin-vue-i18n@0.3.0 (2022-07-07)
|
|
52
|
-
|
|
53
|
-
#### :star: Features
|
|
54
|
-
* [#136](https://github.com/intlify/bundle-tools/pull/136) feat(unplugin-vue-i18n): support fullinstall option ([@kazupon](https://github.com/kazupon))
|
|
55
|
-
* [#135](https://github.com/intlify/bundle-tools/pull/135) feat(unplugin-vue-i18n): support composition only option ([@kazupon](https://github.com/kazupon))
|
|
56
|
-
* [#134](https://github.com/intlify/bundle-tools/pull/134) feat(unplugin-vue-i18n): support runtimeOnly option ([@kazupon](https://github.com/kazupon))
|
|
57
|
-
|
|
58
|
-
#### :pencil: Documentation
|
|
59
|
-
* [#133](https://github.com/intlify/bundle-tools/pull/133) docs: consistent plugin name and add Nuxt ([@Atinux](https://github.com/Atinux))
|
|
60
|
-
|
|
61
|
-
#### Committers: 2
|
|
62
|
-
- Sébastien Chopin ([@Atinux](https://github.com/Atinux))
|
|
63
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
## @intlify/unplugin-vue-i18n@0.2.1 (2022-05-07)
|
|
67
|
-
|
|
68
|
-
#### :bug: Bug Fixes
|
|
69
|
-
* [#118](https://github.com/intlify/bundle-tools/pull/118) fix(unplugin-vue-i18n): code transforming strictly ([@kazupon](https://github.com/kazupon))
|
|
70
|
-
|
|
71
|
-
#### Committers: 1
|
|
72
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
## @intlify/unplugin-vue-i18n@0.2.0 (2022-05-06)
|
|
76
|
-
|
|
77
|
-
#### :star: Features
|
|
78
|
-
* [#117](https://github.com/intlify/bundle-tools/pull/117) feat: support virtual resource importing ([@kazupon](https://github.com/kazupon))
|
|
79
|
-
|
|
80
|
-
#### Committers: 1
|
|
81
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
## @intlify/unplugin-vue-i18n@0.1.2 (2022-05-06)
|
|
85
|
-
|
|
86
|
-
#### :bug: Bug Fixes
|
|
87
|
-
* [#115](https://github.com/intlify/bundle-tools/pull/115) fix(unplugin-vue-i18n): export d.ts files ([@kazupon](https://github.com/kazupon))
|
|
88
|
-
|
|
89
|
-
#### Committers: 1
|
|
90
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
## @intlify/unplugin-vue-i18n@0.1.1 (2022-05-06)
|
|
94
|
-
|
|
95
|
-
#### :bug: Bug Fixes
|
|
96
|
-
* [#114](https://github.com/intlify/bundle-tools/pull/114) fix(unplugin-vue-i18n): export types ([@kazupon](https://github.com/kazupon))
|
|
97
|
-
|
|
98
|
-
#### Committers: 1
|
|
99
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
## @intlify/unplugin-vue-i18n@0.1.0 (2022-05-06)
|
|
103
|
-
|
|
104
|
-
#### :star: Features
|
|
105
|
-
* [#113](https://github.com/intlify/bundle-tools/pull/113) feat: unplugin basic implementation for vue-i18n ([@kazupon](https://github.com/kazupon))
|
|
106
|
-
|
|
107
|
-
#### Committers: 1
|
|
108
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
109
|
-
|
|
110
|
-
## @intlify/unplugin-vue-i18n@0.0.0 (2022-05-02)
|
|
111
|
-
|
|
112
|
-
:tada: Initial release.
|