diff --git a/package.json b/package.json index b850a552273d..a415e3ffe198 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "bin", "dist", "types", - "client.d.ts" + "client.d.ts", + "theme.d.ts" ], "scripts": { "dev": "run-s dev-shared dev-start", diff --git a/src/node/markdown/plugins/containers.ts b/src/node/markdown/plugins/containers.ts index 61dd7b91f885..9e3caa23e9b8 100644 --- a/src/node/markdown/plugins/containers.ts +++ b/src/node/markdown/plugins/containers.ts @@ -33,7 +33,9 @@ function createContainer(klass: string, defaultTitle: string): ContainerArgs { const info = token.info.trim().slice(klass.length).trim() if (token.nesting === 1) { if (klass === 'details') { - return `
${info ? `${info}` : ''}\n` + return `
${ + info ? `${info}` : '' + }\n` } return `

${ info || defaultTitle diff --git a/src/node/serve/serve.ts b/src/node/serve/serve.ts index 63a2aeddad34..778f7e72612e 100644 --- a/src/node/serve/serve.ts +++ b/src/node/serve/serve.ts @@ -23,7 +23,7 @@ export interface ServeOptions { export async function serve(options: ServeOptions = {}) { const port = options.port !== undefined ? options.port : 5000 const site = await resolveConfig(options.root, 'serve', 'production') - const base = trimChar(site?.site?.base ?? "", "/") + const base = trimChar(site?.site?.base ?? '', '/') const compress = compression() const serve = sirv(site.outDir, { diff --git a/src/shared/shared.ts b/src/shared/shared.ts index 1e1e0a5a4bf2..8742fded7772 100644 --- a/src/shared/shared.ts +++ b/src/shared/shared.ts @@ -6,7 +6,7 @@ export type { HeadConfig, LocaleConfig, Header, - DefaultTheme, + DefaultTheme } from '../../types/shared' export const EXTERNAL_URL_RE = /^https?:/i diff --git a/theme.d.ts b/theme.d.ts index dd034b53b298..576a81eff9f2 100644 --- a/theme.d.ts +++ b/theme.d.ts @@ -1,3 +1,4 @@ // so that users can do `import DefaultTheme from 'vitepress/theme'` -import DefaultTheme from './dist/client/theme-default/index' -export default DefaultTheme +import { Theme } from 'vitepress' +declare const theme: Theme +export default theme