-
构建错误
> [email protected] build
> npm run build:ssg
> [email protected] build:ssg
> valaxy build --ssg
[start] Resolve valaxy config...
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
[success] Resolve userValaxyConfig from /home/runner/work/lhqm.github.io/lhqm.github.io/valaxy.config.ts 4.77s
[success] Resolve siteConfig from /home/runner/work/lhqm.github.io/lhqm.github.io/site.config.ts 207.03ms
[success] Resolve valaxy.config.ts from theme(yun) 352.02ms
- Resolve addons from /home/runner/work/lhqm.github.io/lhqm.github.io
✔ Resolve addons from /home/runner/work/lhqm.github.io/lhqm.github.io
🌌 Valaxy v0.17.2
🪐 theme > yun
📁 /home/runner/work/lhqm.github.io/lhqm.github.io
[info] use vite-ssg to do ssg build...
[vite-ssg] Build for client...
node_modules/valaxy-theme-yun/components/third/YunTwikoo.vue?vue&type=script&setup=true&lang.ts (1[9](https://github.com/lhqm/lhqm.github.io/actions/runs/7648989407/job/20842660218#step:5:10):[14](https://github.com/lhqm/lhqm.github.io/actions/runs/7648989407/job/20842660218#step:5:15)) "useTwikooWithOptions" is not exported by "node_modules/valaxy/client/addons/index.ts", imported by "node_modules/valaxy-theme-yun/components/third/YunTwikoo.vue?vue&type=script&setup=true&lang.ts".
node_modules/valaxy-theme-yun/components/third/YunWaline.vue?vue&type=script&setup=true&lang.ts ([15](https://github.com/lhqm/lhqm.github.io/actions/runs/7648989407/job/20842660218#step:5:16):26) "useAddonWaline" is not exported by "node_modules/valaxy/client/addons/index.ts", imported by "node_modules/valaxy-theme-yun/components/third/YunWaline.vue?vue&type=script&setup=true&lang.ts".
node_modules/valaxy-theme-yun/components/third/YunAlgoliaSearch.vue?vue&type=script&setup=true&lang.ts (21:53) "useAddonAlgolia" is not exported by "node_modules/valaxy/client/addons/index.ts", imported by "node_modules/valaxy-theme-yun/components/third/YunAlgoliaSearch.vue?vue&type=script&setup=true&lang.ts".
[vite-ssg] Build for server...
node_modules/valaxy-theme-yun/components/third/YunTwikoo.vue?vue&type=script&setup=true&lang.ts ([16](https://github.com/lhqm/lhqm.github.io/actions/runs/7648989407/job/20842660218#step:5:17):14) "useTwikooWithOptions" is not exported by "node_modules/valaxy/client/addons/index.ts", imported by "node_modules/valaxy-theme-yun/components/third/YunTwikoo.vue?vue&type=script&setup=true&lang.ts".
node_modules/valaxy-theme-yun/components/third/YunWaline.vue?vue&type=script&setup=true&lang.ts ([17](https://github.com/lhqm/lhqm.github.io/actions/runs/7648989407/job/20842660218#step:5:18):26) "useAddonWaline" is not exported by "node_modules/valaxy/client/addons/index.ts", imported by "node_modules/valaxy-theme-yun/components/third/YunWaline.vue?vue&type=script&setup=true&lang.ts".
node_modules/valaxy-theme-yun/components/third/YunAlgoliaSearch.vue?vue&type=script&setup=true&lang.ts (23:53) "useAddonAlgolia" is not exported by "node_modules/valaxy/client/addons/index.ts", imported by "node_modules/valaxy-theme-yun/components/third/YunAlgoliaSearch.vue?vue&type=script&setup=true&lang.ts". 该现象在本地和github自动化部署均出现,最终打包后静态站变成了这样: 我的配置文件
import { defineValaxyConfig } from 'valaxy'
import type { UserThemeConfig } from 'valaxy-theme-yun'
// add icons what you will need
const safelist = [
'i-ri-home-line',
]
/**
* User Config
*/
export default defineValaxyConfig<UserThemeConfig>({
// site config see site.config.ts
theme: 'yun',
themeConfig: {
banner: {
enable: true,
title: '离狐千慕',
cloud: {
enable: true,
},
},
pages: [
{
name: '我的小伙伴们',
url: '/links/',
icon: 'i-ri-genderless-line',
color: 'dodgerblue',
},
{
name: '喜欢的女孩子',
url: '/girls/',
icon: 'i-ri-women-line',
color: 'hotpink',
},
],
footer: {
since: 2022,
beian: {
enable: true,
icp: '啊喔,这个烂崽没有备案',
},
},
},
unocss: { safelist },
})
import { defineSiteConfig } from 'valaxy'
export default defineSiteConfig({
url: 'https://valaxy.site/',
lang: 'zh-CN',
title: '狐狸小窝',
author: {
avatar: '/fox.jpg',
name: '离狐千慕',
},
favicon:"favicon.ico",
subtitle:'木秀于林,风必摧之。',
description: '什么废物东西',
search: {
enable: false,
},
//文本渲染选项
frontmatter:{
//古早文章提示
time_warning: true,
toc: true,
draft: true
},
//代码块最大高度
codeHeightLimit: 300,
//允许文章加密
encrypt:{
enable:true
},
//图片中变焦
mediumZoom:{
enable: true
},
// 图片懒加载
vanillaLazyload:{
enable: true
},
}) 请大佬们帮忙看看,如果需要追加其他配置文件,我继续追加提供,谢谢大佬们! |
Beta Was this translation helpful? Give feedback.
Answered by
YunYouJun
Jan 25, 2024
Replies: 2 comments 5 replies
-
把文本渲染选项中的 |
Beta Was this translation helpful? Give feedback.
1 reply
-
提供一下可复现仓库? 以及这里的 frontmatter 代表是为自己的所有文章都添加的全局 frontmatter,不应该添加 最好加在每个文件自己的 frontmatter 里。 |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
lhqm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
提供一下可复现仓库?
以及这里的 frontmatter 代表是为自己的所有文章都添加的全局 frontmatter,不应该添加
draft: true
。最好加在每个文件自己的 frontmatter 里。