refactor: remove @theme aliases

pull/1136/head
Divyansh Singh 3 years ago
parent ba9aa72d9b
commit 952de911a6

@ -7,7 +7,7 @@ import {
onMounted,
watch
} from 'vue'
import Theme from '/@theme/index'
import Theme from '../theme-default'
import { inBrowser, pathToFile } from './utils'
import { Router, RouterSymbol, createRouter } from './router'
import { siteDataRef, useData } from './data'

@ -11,7 +11,6 @@
"lib": ["ESNext", "DOM"],
"types": ["vite/client"],
"paths": {
"/@theme/*": ["theme-default/*"],
"vitepress": ["index.ts"],
"vitepress/theme": ["../../types/default-theme.d"]
}

@ -16,17 +16,11 @@ 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[] = [
...Object.keys(paths).map((p) => ({
find: p,
replacement: paths[p]
})),
{
find: SITE_DATA_ID,
replacement: SITE_DATA_REQUEST_PATH
},
{
find: /^vitepress$/,
replacement: join(DIST_CLIENT_PATH, '/index')

Loading…
Cancel
Save