nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.75k stars 483 forks source link

fix: rollup comment annotation warning #2723

Closed BobbieGoede closed 9 months ago

BobbieGoede commented 10 months ago

🔗 Linked issue

❓ Type of change

📚 Description

Resolves #2640

Not sure if it this is the correct way to solve this issue, I don't exactly understand how the comment works and should be handled. I looked at https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/pages/runtime/composables.ts#L55-L83 for reference, our defineI18nRoute macro works in a similar way to definePageMeta in Nuxt but that doesn't use a comment like this, while defineRouteRules does which is also similar to our macro.

Let me know if this should be solved differently, this change simply removes the comment and adds a usage check just like definePageMeta has.

📝 Checklist

danielroe commented 10 months ago

I think if you update to /*@__PURE__*/ it will prevent the warning.