fix: vite clientDeps optimize make unplugin-vue-router Symbol(loaderEntries) invalid

This commit is contained in:
YunYouJun 2025-07-12 23:38:00 +08:00
parent 6a9a36e4a6
commit 3fe4a742e3
2 changed files with 10 additions and 5 deletions

View File

@ -1,7 +1,7 @@
<script lang="ts" setup>
import type { Post } from 'valaxy'
// import { useLayout } from 'valaxy'
import { useLayout } from 'valaxy'
import YunPostMeta from 'valaxy-theme-yun/components/YunPostMeta.vue'
defineProps<{
@ -9,13 +9,13 @@ defineProps<{
}>()
// Post
// const isPost = useLayout('post')
const isPost = useLayout('post')
</script>
<template>
<YunPostMeta :frontmatter="frontmatter">
<!-- <span v-if="isPost" id="busuanzi_container_page_pv">
<span v-if="isPost" id="busuanzi_container_page_pv">
本文总阅读量 <span id="busuanzi_value_page_pv" />
</span> -->
</span>
</YunPostMeta>
</template>

View File

@ -30,7 +30,6 @@ const clientDeps = [
// vue
'vue',
'vue-router',
'unplugin-vue-router/data-loaders/basic',
'vue-i18n',
// dev
@ -72,6 +71,12 @@ const EXCLUDE = [
'/@valaxyjs/addons',
'/@valaxyjs/locales',
'/@valaxyjs/styles',
/**
* unplugin-vue-router
* exclude to avoid vite optimize, will make Symbol('loaderEntries') valid
*/
'unplugin-vue-router/data-loaders/basic',
]
export function createConfigPlugin(options: ResolvedValaxyOptions): Plugin {