nuxtlabs / nuxt-component-meta

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

feat: allow using regex or function in exclude option #53

Closed stafyniaksacha closed 1 year ago

stafyniaksacha commented 1 year ago

This allow using regex or custom function in component meta module

export default defineNuxtConfig({
  componentMeta: {
    exclude: [/test/i, (component: any) => {
      return component.global
    }]
  },
})

Also, removed exculde from component meta checker option as we exclude items upstream

stafyniaksacha commented 1 year ago

moved to https://github.com/nuxtlabs/nuxt-component-meta/issues/51#issuecomment-1466023766

Atinux commented 1 year ago

Approved maybe too fast, I think it could be nice to see how it works for each layer.

Tahul commented 1 year ago

Hey; this looks good to me.

We can improve granularity in subsequent PRs, but this seem to add the possibility to use regexes without losing the current exclude feature set.