|
|
@ -5,13 +5,13 @@ import { Alias, AliasOptions } from 'vite'
|
|
|
|
|
|
|
|
|
|
|
|
const require = createRequire(import.meta.url)
|
|
|
|
const require = createRequire(import.meta.url)
|
|
|
|
const PKG_ROOT = resolve(fileURLToPath(import.meta.url), '../..')
|
|
|
|
const PKG_ROOT = resolve(fileURLToPath(import.meta.url), '../..')
|
|
|
|
|
|
|
|
|
|
|
|
export const DIST_CLIENT_PATH = resolve(PKG_ROOT, 'client')
|
|
|
|
export const DIST_CLIENT_PATH = resolve(PKG_ROOT, 'client')
|
|
|
|
export const APP_PATH = join(DIST_CLIENT_PATH, 'app')
|
|
|
|
export const APP_PATH = join(DIST_CLIENT_PATH, 'app')
|
|
|
|
export const SHARED_PATH = join(DIST_CLIENT_PATH, 'shared')
|
|
|
|
export const SHARED_PATH = join(DIST_CLIENT_PATH, 'shared')
|
|
|
|
export const DEFAULT_THEME_PATH = join(DIST_CLIENT_PATH, 'theme-default')
|
|
|
|
export const DEFAULT_THEME_PATH = join(DIST_CLIENT_PATH, 'theme-default')
|
|
|
|
|
|
|
|
|
|
|
|
// special virtual file
|
|
|
|
// special virtual file. we can't directly import '/@siteData' because
|
|
|
|
// we can't directly import '/@siteData' because
|
|
|
|
|
|
|
|
// - it's not an actual file so we can't use tsconfig paths to redirect it
|
|
|
|
// - it's not an actual file so we can't use tsconfig paths to redirect it
|
|
|
|
// - TS doesn't allow shimming a module that starts with '/'
|
|
|
|
// - TS doesn't allow shimming a module that starts with '/'
|
|
|
|
export const SITE_DATA_ID = '@siteData'
|
|
|
|
export const SITE_DATA_ID = '@siteData'
|
|
|
@ -49,9 +49,12 @@ export function resolveAliases(root: string, themeDir: string): AliasOptions {
|
|
|
|
replacement: join(DIST_CLIENT_PATH, '/theme-default/index')
|
|
|
|
replacement: join(DIST_CLIENT_PATH, '/theme-default/index')
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// alias for local linked development
|
|
|
|
// alias for local linked development
|
|
|
|
{ find: /^vitepress\//, replacement: PKG_ROOT + '/' },
|
|
|
|
{
|
|
|
|
// make sure it always use the same vue dependency that comes with
|
|
|
|
find: /^vitepress\//,
|
|
|
|
// vitepress itself
|
|
|
|
replacement: PKG_ROOT + '/'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// make sure it always use the same vue dependency that comes
|
|
|
|
|
|
|
|
// with vitepress itself
|
|
|
|
{
|
|
|
|
{
|
|
|
|
find: /^vue$/,
|
|
|
|
find: /^vue$/,
|
|
|
|
replacement: vuePath
|
|
|
|
replacement: vuePath
|
|
|
|