diff --git a/src/client/index.ts b/src/client/index.ts index 8dc04483..4bbc0251 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -5,7 +5,7 @@ export type { Router, Route } from './app/router' // theme types -export * from './app/theme' +export type { Theme, EnhanceAppContext } from './app/theme' // composables export { useRouter, useRoute } from './app/router' @@ -24,6 +24,3 @@ import { ComponentOptions } from 'vue' import _Debug from './app/components/Debug.vue' const Debug = _Debug as ComponentOptions export { Debug } - -// default theme -export { default as DefaultTheme } from './theme-default' diff --git a/src/node/alias.ts b/src/node/alias.ts index fbe2cea5..15bc8290 100644 --- a/src/node/alias.ts +++ b/src/node/alias.ts @@ -38,6 +38,10 @@ export function resolveAliases( find: /^vitepress$/, replacement: path.join(__dirname, '../client/index') }, + { + find: /^vitepress\/theme$/, + replacement: path.join(__dirname, '../client/theme-default/index') + }, // alias for local linked development { find: /^vitepress\//, replacement: PKG_ROOT + '/' }, // make sure it always use the same vue dependency that comes with diff --git a/theme.d.ts b/theme.d.ts new file mode 100644 index 00000000..dd034b53 --- /dev/null +++ b/theme.d.ts @@ -0,0 +1,3 @@ +// so that users can do `import DefaultTheme from 'vitepress/theme'` +import DefaultTheme from './dist/client/theme-default/index' +export default DefaultTheme diff --git a/types/index.d.ts b/types/index.d.ts index fb753f96..10a5d0c2 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,5 +1,4 @@ export * from './shared' export * from '../dist/node/index' -export * from '../dist/client/app/exports' +export * from '../dist/client/index' export * from '../dist/client/theme-default/config' -export { default as defaultTheme } from '../dist/client/theme-default/index'