生产环境打包速度

This commit is contained in:
tangly1024
2021-12-17 21:14:26 +08:00
parent d611814a27
commit 58f4fff45f
3 changed files with 5 additions and 3 deletions

View File

@@ -31,7 +31,9 @@ const Slug = ({ post, blockMap, tags, prev, next, allPosts, recommendPosts, cate
export async function getStaticPaths () {
let posts = []
posts = await getAllPosts({ from: 'slug - paths', includePage: true })
if (BLOG.isProd) {
posts = await getAllPosts({ from: 'slug - paths', includePage: true })
}
return {
paths: posts.map(row => `${BLOG.path}/article/${row.slug}`),
fallback: true