|
|
@ -15,7 +15,11 @@ import {
|
|
|
|
} from 'vite'
|
|
|
|
} from 'vite'
|
|
|
|
import { DEFAULT_THEME_PATH } from './alias'
|
|
|
|
import { DEFAULT_THEME_PATH } from './alias'
|
|
|
|
import type { MarkdownOptions } from './markdown/markdown'
|
|
|
|
import type { MarkdownOptions } from './markdown/markdown'
|
|
|
|
import { dynamicRouteRE } from './plugins/dynamicRoutesPlugin'
|
|
|
|
import {
|
|
|
|
|
|
|
|
dynamicRouteRE,
|
|
|
|
|
|
|
|
resolveRoutes,
|
|
|
|
|
|
|
|
type ResolvedRouteConfig
|
|
|
|
|
|
|
|
} from './plugins/dynamicRoutesPlugin'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
APPEARANCE_KEY,
|
|
|
|
APPEARANCE_KEY,
|
|
|
|
type Awaitable,
|
|
|
|
type Awaitable,
|
|
|
@ -179,7 +183,7 @@ export interface SiteConfig<ThemeConfig = any>
|
|
|
|
cacheDir: string
|
|
|
|
cacheDir: string
|
|
|
|
tempDir: string
|
|
|
|
tempDir: string
|
|
|
|
pages: string[]
|
|
|
|
pages: string[]
|
|
|
|
dynamicRoutes: string[]
|
|
|
|
dynamicRoutes: readonly [ResolvedRouteConfig[], Record<string, string[]>]
|
|
|
|
rewrites: {
|
|
|
|
rewrites: {
|
|
|
|
map: Record<string, string | undefined>
|
|
|
|
map: Record<string, string | undefined>
|
|
|
|
inv: Record<string, string | undefined>
|
|
|
|
inv: Record<string, string | undefined>
|
|
|
@ -252,7 +256,11 @@ export async function resolveConfig(
|
|
|
|
).sort()
|
|
|
|
).sort()
|
|
|
|
|
|
|
|
|
|
|
|
const pages = allMarkdownFiles.filter((p) => !dynamicRouteRE.test(p))
|
|
|
|
const pages = allMarkdownFiles.filter((p) => !dynamicRouteRE.test(p))
|
|
|
|
const dynamicRoutes = allMarkdownFiles.filter((p) => dynamicRouteRE.test(p))
|
|
|
|
const dynamicRouteFiles = allMarkdownFiles.filter((p) =>
|
|
|
|
|
|
|
|
dynamicRouteRE.test(p)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
const dynamicRoutes = await resolveRoutes(dynamicRouteFiles)
|
|
|
|
|
|
|
|
pages.push(...dynamicRoutes[0].map((r) => r.path))
|
|
|
|
|
|
|
|
|
|
|
|
const rewriteEntries = Object.entries(userConfig.rewrites || {})
|
|
|
|
const rewriteEntries = Object.entries(userConfig.rewrites || {})
|
|
|
|
const rewrites = rewriteEntries.length
|
|
|
|
const rewrites = rewriteEntries.length
|
|
|
|