@intlify/unplugin-vue-i18n 5.3.0 → 5.3.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/lib/index.cjs CHANGED
@@ -703,6 +703,7 @@ function directivePlugin({
703
703
  }) {
704
704
  let vuePlugin = null;
705
705
  let vuePluginOptions = null;
706
+ const excludeLangs = ["pug", "jsx", "tsx"];
706
707
  return {
707
708
  name: resolveNamespace("directive"),
708
709
  enforce: "pre",
@@ -729,16 +730,18 @@ function directivePlugin({
729
730
  }
730
731
  },
731
732
  async transform(code, id) {
732
- const { filename } = parseVueRequest(id);
733
- if (vuePluginOptions == null) {
734
- vuePluginOptions = getVuePluginOptions(vuePlugin);
735
- }
736
733
  if (id.endsWith(".vue")) {
737
- analyzeIdentifiers(
738
- getDescriptor(filename, code, vuePluginOptions),
739
- vuePluginOptions,
740
- translationIdentifiers
741
- );
734
+ const { filename, query } = parseVueRequest(id);
735
+ if (!excludeLangs.includes(query.lang ?? "")) {
736
+ if (vuePluginOptions == null) {
737
+ vuePluginOptions = getVuePluginOptions(vuePlugin);
738
+ }
739
+ analyzeIdentifiers(
740
+ getDescriptor(filename, code, vuePluginOptions),
741
+ vuePluginOptions,
742
+ translationIdentifiers
743
+ );
744
+ }
742
745
  }
743
746
  return {
744
747
  code,
package/lib/index.mjs CHANGED
@@ -691,6 +691,7 @@ function directivePlugin({
691
691
  }) {
692
692
  let vuePlugin = null;
693
693
  let vuePluginOptions = null;
694
+ const excludeLangs = ["pug", "jsx", "tsx"];
694
695
  return {
695
696
  name: resolveNamespace("directive"),
696
697
  enforce: "pre",
@@ -717,16 +718,18 @@ function directivePlugin({
717
718
  }
718
719
  },
719
720
  async transform(code, id) {
720
- const { filename } = parseVueRequest(id);
721
- if (vuePluginOptions == null) {
722
- vuePluginOptions = getVuePluginOptions(vuePlugin);
723
- }
724
721
  if (id.endsWith(".vue")) {
725
- analyzeIdentifiers(
726
- getDescriptor(filename, code, vuePluginOptions),
727
- vuePluginOptions,
728
- translationIdentifiers
729
- );
722
+ const { filename, query } = parseVueRequest(id);
723
+ if (!excludeLangs.includes(query.lang ?? "")) {
724
+ if (vuePluginOptions == null) {
725
+ vuePluginOptions = getVuePluginOptions(vuePlugin);
726
+ }
727
+ analyzeIdentifiers(
728
+ getDescriptor(filename, code, vuePluginOptions),
729
+ vuePluginOptions,
730
+ translationIdentifiers
731
+ );
732
+ }
730
733
  }
731
734
  return {
732
735
  code,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlify/unplugin-vue-i18n",
3
- "version": "5.3.0",
3
+ "version": "5.3.1",
4
4
  "description": "unplugin for Vue I18n",
5
5
  "author": {
6
6
  "name": "kazuya kawaguchi",