Skip to content

Commit

Permalink
revert: 952de91
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Jul 14, 2022
1 parent 0e522e7 commit 5c2854f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/client/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
onMounted,
watch
} from 'vue'
import Theme from '../theme-default'
import Theme from '/@theme/index'
import { inBrowser, pathToFile } from './utils'
import { Router, RouterSymbol, createRouter } from './router'
import { siteDataRef, useData } from './data'
Expand Down
1 change: 1 addition & 0 deletions src/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"lib": ["ESNext", "DOM"],
"types": ["vite/client"],
"paths": {
"/@theme/*": ["theme-default/*"],
"vitepress": ["index.ts"],
"vitepress/theme": ["../../types/default-theme.d"]
}
Expand Down
14 changes: 10 additions & 4 deletions src/node/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ export const SITE_DATA_ID = '@siteData'
export const SITE_DATA_REQUEST_PATH = '/' + SITE_DATA_ID

export function resolveAliases(root: string, themeDir: string): AliasOptions {
const paths: Record<string, string> = {
'/@theme': themeDir,
'@theme': themeDir,
[SITE_DATA_ID]: SITE_DATA_REQUEST_PATH
}

const aliases: Alias[] = [
{
find: SITE_DATA_ID,
replacement: SITE_DATA_REQUEST_PATH
},
...Object.keys(paths).map((p) => ({
find: p,
replacement: paths[p]
})),
{
find: /^vitepress$/,
replacement: join(DIST_CLIENT_PATH, '/index')
Expand Down

0 comments on commit 5c2854f

Please sign in to comment.