From db45616cf523d379c76bbdbb8b190fef16026812 Mon Sep 17 00:00:00 2001 From: Bobbie Goede Date: Sat, 21 Dec 2024 00:57:46 +0100 Subject: [PATCH 1/2] fix: only return transform for vue files --- packages/unplugin-vue-i18n/src/core/directive.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/unplugin-vue-i18n/src/core/directive.ts b/packages/unplugin-vue-i18n/src/core/directive.ts index 8729652..0d4795d 100644 --- a/packages/unplugin-vue-i18n/src/core/directive.ts +++ b/packages/unplugin-vue-i18n/src/core/directive.ts @@ -91,11 +91,10 @@ export function directivePlugin({ ) } } - } - - return { - code, - map: { version: 3, mappings: '', sources: [] } as any + return { + code, + map: { version: 3, mappings: '', sources: [] } as any + } } } } From 2cedc20001569e36f65a0dfe606e3f26b959f6cc Mon Sep 17 00:00:00 2001 From: Bobbie Goede Date: Sat, 21 Dec 2024 01:00:19 +0100 Subject: [PATCH 2/2] fix: move return statement inside compiler check --- packages/unplugin-vue-i18n/src/core/directive.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/unplugin-vue-i18n/src/core/directive.ts b/packages/unplugin-vue-i18n/src/core/directive.ts index 0d4795d..e82782e 100644 --- a/packages/unplugin-vue-i18n/src/core/directive.ts +++ b/packages/unplugin-vue-i18n/src/core/directive.ts @@ -89,12 +89,12 @@ export function directivePlugin({ vuePluginOptions, translationIdentifiers ) + return { + code, + map: { version: 3, mappings: '', sources: [] } as any + } } } - return { - code, - map: { version: 3, mappings: '', sources: [] } as any - } } } }