@intlify/unplugin-vue-i18n 0.2.0 → 0.2.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 +9 -0
- package/lib/index.cjs +9 -1
- package/lib/index.mjs +9 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
|
|
2
|
+
## @intlify/unplugin-vue-i18n@0.2.1 (2022-05-07)
|
|
3
|
+
|
|
4
|
+
#### :bug: Bug Fixes
|
|
5
|
+
* [#118](https://github.com/intlify/bundle-tools/pull/118) fix(unplugin-vue-i18n): code transforming strictly ([@kazupon](https://github.com/kazupon))
|
|
6
|
+
|
|
7
|
+
#### Committers: 1
|
|
8
|
+
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
9
|
+
|
|
10
|
+
|
|
2
11
|
## @intlify/unplugin-vue-i18n@0.2.0 (2022-05-06)
|
|
3
12
|
|
|
4
13
|
#### :star: Features
|
package/lib/index.cjs
CHANGED
|
@@ -121,6 +121,15 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
121
121
|
return {
|
|
122
122
|
name: "unplugin-vue-i18n",
|
|
123
123
|
enforce: meta.framework === "vite" ? "pre" : "post",
|
|
124
|
+
transformInclude(id) {
|
|
125
|
+
debug("transformInclude", id);
|
|
126
|
+
if (meta.framework === "vite") {
|
|
127
|
+
return true;
|
|
128
|
+
} else {
|
|
129
|
+
const { filename } = parseVueRequest(id);
|
|
130
|
+
return filename.endsWith("vue") || filename.endsWith(INTLIFY_BUNDLE_IMPORT_ID) || filename.endsWith(INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID) ? true : /\.(json5?|ya?ml)$/.test(id) && filter(id);
|
|
131
|
+
}
|
|
132
|
+
},
|
|
124
133
|
vite: {
|
|
125
134
|
configResolved(config) {
|
|
126
135
|
isProduction = config.isProduction;
|
|
@@ -189,7 +198,6 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
189
198
|
async transform(code, id) {
|
|
190
199
|
const { filename, query } = parseVueRequest(id);
|
|
191
200
|
debug("transform", id, JSON.stringify(query), filename);
|
|
192
|
-
debug("transform (code)", code);
|
|
193
201
|
let langInfo = defaultSFCLang;
|
|
194
202
|
let inSourceMap;
|
|
195
203
|
if (!query.vue) {
|
package/lib/index.mjs
CHANGED
|
@@ -110,6 +110,15 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
110
110
|
return {
|
|
111
111
|
name: "unplugin-vue-i18n",
|
|
112
112
|
enforce: meta.framework === "vite" ? "pre" : "post",
|
|
113
|
+
transformInclude(id) {
|
|
114
|
+
debug("transformInclude", id);
|
|
115
|
+
if (meta.framework === "vite") {
|
|
116
|
+
return true;
|
|
117
|
+
} else {
|
|
118
|
+
const { filename } = parseVueRequest(id);
|
|
119
|
+
return filename.endsWith("vue") || filename.endsWith(INTLIFY_BUNDLE_IMPORT_ID) || filename.endsWith(INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID) ? true : /\.(json5?|ya?ml)$/.test(id) && filter(id);
|
|
120
|
+
}
|
|
121
|
+
},
|
|
113
122
|
vite: {
|
|
114
123
|
configResolved(config) {
|
|
115
124
|
isProduction = config.isProduction;
|
|
@@ -178,7 +187,6 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
178
187
|
async transform(code, id) {
|
|
179
188
|
const { filename, query } = parseVueRequest(id);
|
|
180
189
|
debug("transform", id, JSON.stringify(query), filename);
|
|
181
|
-
debug("transform (code)", code);
|
|
182
190
|
let langInfo = defaultSFCLang;
|
|
183
191
|
let inSourceMap;
|
|
184
192
|
if (!query.vue) {
|