Nuxt Component Meta
Gather components metadata on build time and make them available on production
💡 This module depends on @nuxt/bridge
Quick Setup
- Add
nuxt-component-meta
dependency to your project:
yarn add --dev nuxt-component-meta
npm install --save-dev nuxt-component-meta
- Add
nuxt-component-meta/module
to the buildModules
section of your nuxt.config.js
{
buildModules: ['nuxt-component-meta/module']
}
Usage
<template>
<div>
<h2>`MyComponent` metadata</h2>
<pre>
{{ component }}
</pre>
</div>
</template>
<script>
import { getComponent } from 'nuxt-component-meta'
export default {
data() {
return {
meta: getComponent('my-component')
}
}
}
</script>
Development
- Clone this repository
- Install dependencies using
yarn install
- Start dev server using
yarn dev