@intlify/unplugin-vue-i18n 6.0.7 → 6.0.8
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/lib/index.cjs +7 -3
- package/lib/index.mjs +7 -3
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -260,8 +260,8 @@ function resourcePlugin({
|
|
|
260
260
|
);
|
|
261
261
|
const jsonPlugin = getVitePlugin(config, "vite:json");
|
|
262
262
|
if (jsonPlugin) {
|
|
263
|
-
const orgTransform = jsonPlugin.transform;
|
|
264
|
-
|
|
263
|
+
const orgTransform = "handler" in jsonPlugin.transform ? jsonPlugin.transform.handler : jsonPlugin.transform;
|
|
264
|
+
async function overrideJson(code, id) {
|
|
265
265
|
if (!/\.json$/.test(id) || filter(id)) {
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
@@ -271,7 +271,11 @@ function resourcePlugin({
|
|
|
271
271
|
}
|
|
272
272
|
debug$2("org json plugin");
|
|
273
273
|
return orgTransform.apply(this, [code, id]);
|
|
274
|
-
}
|
|
274
|
+
}
|
|
275
|
+
if ("handler" in jsonPlugin.transform) {
|
|
276
|
+
jsonPlugin.transform.handler = overrideJson;
|
|
277
|
+
}
|
|
278
|
+
jsonPlugin.transform = overrideJson;
|
|
275
279
|
}
|
|
276
280
|
const esbuildPlugin = getVitePlugin(config, "vite:esbuild");
|
|
277
281
|
if (esbuildPlugin) {
|
package/lib/index.mjs
CHANGED
|
@@ -248,8 +248,8 @@ function resourcePlugin({
|
|
|
248
248
|
);
|
|
249
249
|
const jsonPlugin = getVitePlugin(config, "vite:json");
|
|
250
250
|
if (jsonPlugin) {
|
|
251
|
-
const orgTransform = jsonPlugin.transform;
|
|
252
|
-
|
|
251
|
+
const orgTransform = "handler" in jsonPlugin.transform ? jsonPlugin.transform.handler : jsonPlugin.transform;
|
|
252
|
+
async function overrideJson(code, id) {
|
|
253
253
|
if (!/\.json$/.test(id) || filter(id)) {
|
|
254
254
|
return;
|
|
255
255
|
}
|
|
@@ -259,7 +259,11 @@ function resourcePlugin({
|
|
|
259
259
|
}
|
|
260
260
|
debug$2("org json plugin");
|
|
261
261
|
return orgTransform.apply(this, [code, id]);
|
|
262
|
-
}
|
|
262
|
+
}
|
|
263
|
+
if ("handler" in jsonPlugin.transform) {
|
|
264
|
+
jsonPlugin.transform.handler = overrideJson;
|
|
265
|
+
}
|
|
266
|
+
jsonPlugin.transform = overrideJson;
|
|
263
267
|
}
|
|
264
268
|
const esbuildPlugin = getVitePlugin(config, "vite:esbuild");
|
|
265
269
|
if (esbuildPlugin) {
|