From 4a53965baf28e542bab5c9643249d2bba9b25702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Fri, 6 Dec 2024 06:26:59 +0100 Subject: [PATCH] fix: check for vue compiler in directive transform hook (#421) --- packages/unplugin-vue-i18n/src/core/directive.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/unplugin-vue-i18n/src/core/directive.ts b/packages/unplugin-vue-i18n/src/core/directive.ts index 2b1e516..8729652 100644 --- a/packages/unplugin-vue-i18n/src/core/directive.ts +++ b/packages/unplugin-vue-i18n/src/core/directive.ts @@ -83,11 +83,13 @@ export function directivePlugin({ if (vuePluginOptions == null) { vuePluginOptions = getVuePluginOptions(vuePlugin!) } - analyzeIdentifiers( - getDescriptor(filename, code, vuePluginOptions), - vuePluginOptions, - translationIdentifiers - ) + if (vuePluginOptions?.compiler) { + analyzeIdentifiers( + getDescriptor(filename, code, vuePluginOptions), + vuePluginOptions, + translationIdentifiers + ) + } } }