Add @nuxt/content dependency to your project:
Yarn
yarn add @nuxt/content@^1Then, add @nuxt/content to the modules section of nuxt.config.js:
nuxt.config.js
{ modules: [ '@nuxt/content' ], content: { // Options }}TypeScript
Add the types to your "types" array in tsconfig.json after the @nuxt/types (Nuxt 2.9.0+) or @nuxt/vue-app entry.
tsconfig.json
{ "compilerOptions": { "types": [ "@nuxt/types", "@nuxt/content" ] }}Why?
Because of the way Nuxt works the
$contentproperty on the context has to be merged into the NuxtContextinterface via declaration merging. Adding@nuxt/contentto your types will import the types from the package and make TypeScript aware of the additions to theContextinterface.