feat: optimize blog build and deployment

This commit is contained in:
liumangmang
2026-05-11 01:35:38 +08:00
parent b4653e209c
commit 1b3e4c33a4
21 changed files with 10015 additions and 523 deletions
+24 -25
View File
@@ -1,38 +1,37 @@
import {defineUserConfig} from "vuepress";
import {viteBundler} from "@vuepress/bundler-vite";
import {getDirname, path} from "vuepress/utils";
import theme from "./theme.js";
import { defineUserConfig } from 'vuepress';
import { viteBundler } from '@vuepress/bundler-vite';
import { getDirname, path } from 'vuepress/utils';
import theme from './theme.js';
const __dirname = getDirname(import.meta.url);
export default defineUserConfig({
base: "/",
base: '/',
lang: "zh-CN",
title: "氓氓小栈",
description: "氓氓小栈",
lang: 'zh-CN',
title: '氓氓小栈',
description: '氓氓小栈',
theme,
bundler: viteBundler({
viteOptions: {
css: {
preprocessorOptions: {
scss: {
quietDeps: true,
silenceDeprecations: ["if-function"],
},
},
},
bundler: viteBundler({
viteOptions: {
css: {
preprocessorOptions: {
scss: {
quietDeps: true,
silenceDeprecations: ['if-function'],
},
},
}),
},
},
}),
alias: {
"@theme-hope/modules/blog/components/BlogHero": path.resolve(
__dirname,
"./components/BlogHero.vue",
'@theme-hope/components/blog/BlogHero': path.resolve(__dirname, './components/BlogHero.vue'),
'@theme-hope/modules/blog/components/BlogHero': path.resolve(
__dirname,
'./components/BlogHero.vue',
),
},
// 和 PWA 一起启用
// shouldPrefetch: false,
// VuePress 默认会预取页面资源;如后续启用 PWA,可按需显式调整。
});