File tree 5 files changed +12
-3
lines changed
5 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 2
2
// so the user can do `import { useRoute, useSiteData } from 'vitepress'`
3
3
4
4
// generic types
5
- export type { SiteData , PageData } from '/@types/shared'
6
5
export type { Router , Route } from './router'
7
6
8
7
// theme types
@@ -25,3 +24,6 @@ import { ComponentOptions } from 'vue'
25
24
import _Debug from './components/Debug.vue'
26
25
const Debug = _Debug as ComponentOptions
27
26
export { Debug }
27
+
28
+ // default theme
29
+ export { default as defaultTheme } from '/@default-theme/index'
Original file line number Diff line number Diff line change 8
8
"types" : [" vite" ],
9
9
"paths" : {
10
10
"/@theme/*" : [" theme-default/*" ],
11
+ "/@default-theme/*" : [" theme-default/*" ],
11
12
"/@shared/*" : [" shared/*" ],
12
13
"/@types/*" : [" ../../types/*" ],
13
14
"vitepress" : [" app/exports.ts" ]
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import path from 'path'
2
2
import fs from 'fs-extra'
3
3
import chalk from 'chalk'
4
4
import globby from 'globby'
5
- import { createResolver , APP_PATH } from './resolver'
5
+ import { createResolver , APP_PATH , DEFAULT_THEME_PATH } from './resolver'
6
6
import { Resolver } from 'vite'
7
7
import { SiteData , HeadConfig , LocaleConfig } from '../../types/shared'
8
8
import { MarkdownOptions } from './markdown/markdown'
@@ -48,7 +48,7 @@ export async function resolveConfig(
48
48
const userThemeDir = resolve ( root , 'theme' )
49
49
const themeDir = ( await fs . pathExists ( userThemeDir ) )
50
50
? userThemeDir
51
- : path . join ( __dirname , '../client/theme-default' )
51
+ : DEFAULT_THEME_PATH
52
52
53
53
const config : SiteConfig = {
54
54
root,
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ import { UserConfig } from './config'
4
4
5
5
export const APP_PATH = path . join ( __dirname , '../client/app' )
6
6
export const SHARED_PATH = path . join ( __dirname , '../client/shared' )
7
+ export const DEFAULT_THEME_PATH = path . join (
8
+ __dirname ,
9
+ '../client/theme-default'
10
+ )
7
11
8
12
// special virtual file
9
13
// we can't directly import '/@siteData' becase
@@ -25,6 +29,7 @@ export function createResolver(
25
29
...userConfig . alias ,
26
30
'/@app/' : APP_PATH ,
27
31
'/@theme/' : themeDir ,
32
+ '/@default-theme/' : DEFAULT_THEME_PATH ,
28
33
'/@shared/' : SHARED_PATH ,
29
34
vitepress : '/@app/exports.js' ,
30
35
[ SITE_DATA_ID ] : SITE_DATA_REQUEST_PATH
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ export * from './shared'
2
2
export * from '../dist/node/index'
3
3
export * from '../dist/client/app/exports'
4
4
export * from '../dist/client/theme-default/config'
5
+ export { default as defaultTheme } from '../dist/client/theme-default/index'
You can’t perform that action at this time.
0 commit comments