nuxtlabs / nuxt-component-meta

Gather Nuxt components metadata on build time and make them available on production.
69 stars 6 forks source link

feat(unplugin): move parsing steps to unplugin #43

Closed Tahul closed 1 year ago

Tahul commented 1 year ago

This PR moves parsing steps inside an Unplugin, instead of the root scope of the Nuxt module.

This allows supporting HMR.

The PR in its current state supports reparsing components on-save, I get the output file (.nuxt/component-meta.mjs) to refresh on each changes, with proper updates.

It needs fixes on HMR before merging, but I can already see few issues:

That would be very helpful to support generating metas from transformed components and not their only the content of the file. That can be useful if the project contains any plugin that may alter the content of