Skip to content

Commit 7eebe27

Browse files
committed
fix: add mdc.components.map to renderer aliases
close #3681
1 parent 5b9d28f commit 7eebe27

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/utils/mdc.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
import type { MdcConfig } from '@nuxtjs/mdc'
1+
import type { MdcConfig, ModuleOptions as MDCModuleOptions } from '@nuxtjs/mdc'
22
import type { Nuxt } from '@nuxt/schema'
33
import { extendViteConfig } from '@nuxt/kit'
44
import { createJiti } from 'jiti'
55
import type { ModuleOptions } from '../types'
66
import { setParserOptions } from './content'
77

88
export async function configureMDCModule(contentOptions: ModuleOptions, nuxt: Nuxt) {
9+
const mdcOptions = (nuxt.options as unknown as { mdc: MDCModuleOptions }).mdc
10+
contentOptions.renderer.alias = {
11+
...(mdcOptions?.components?.map || {}),
12+
...(contentOptions.renderer.alias || {}),
13+
}
14+
915
// Hook into mdc configs and store them for parser
1016
nuxt.hook('mdc:configSources', async (mdcConfigs) => {
1117
if (mdcConfigs.length) {

0 commit comments

Comments
 (0)