|
|
|
@ -6,6 +6,7 @@ import { resolveAliases, APP_PATH, DEFAULT_THEME_PATH } from './alias'
|
|
|
|
|
import { SiteData, HeadConfig, LocaleConfig } from '../../types/shared'
|
|
|
|
|
import { MarkdownOptions } from './markdown/markdown'
|
|
|
|
|
import { AliasOptions } from 'vite'
|
|
|
|
|
import { Options } from '@vitejs/plugin-vue'
|
|
|
|
|
export { resolveSiteDataByRoute } from './shared/config'
|
|
|
|
|
|
|
|
|
|
const debug = require('debug')('vitepress:config')
|
|
|
|
@ -21,7 +22,7 @@ export interface UserConfig<ThemeConfig = any> {
|
|
|
|
|
alias?: Record<string, string>
|
|
|
|
|
markdown?: MarkdownOptions
|
|
|
|
|
customData?: any
|
|
|
|
|
isCustomElement?: (tag: string) => boolean | void
|
|
|
|
|
vueOptions: Options
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface SiteConfig<ThemeConfig = any> {
|
|
|
|
@ -34,7 +35,7 @@ export interface SiteConfig<ThemeConfig = any> {
|
|
|
|
|
alias: AliasOptions
|
|
|
|
|
pages: string[]
|
|
|
|
|
markdown?: MarkdownOptions
|
|
|
|
|
isCustomElement?: (tag: string) => boolean | void
|
|
|
|
|
vueOptions: Options
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const resolve = (root: string, file: string) =>
|
|
|
|
@ -62,7 +63,7 @@ export async function resolveConfig(
|
|
|
|
|
tempDir: path.resolve(APP_PATH, 'temp'),
|
|
|
|
|
markdown: userConfig.markdown,
|
|
|
|
|
alias: resolveAliases(themeDir, userConfig),
|
|
|
|
|
isCustomElement: userConfig.isCustomElement
|
|
|
|
|
vueOptions: userConfig.vueOptions
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return config
|
|
|
|
|