20261007220117
This commit is contained in:
1 parent
9217b3fa42
commit
8b1ec67609
275 files changed
+20026
-49299
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
/**
|
||||
* 文档站(Docus)。
|
||||
*
|
||||
* 几个刻意的选择:
|
||||
* - extends: ['docus'] —— Docus 是 Nuxt Layer,全部能力(导航、搜索、主题)由它提供
|
||||
* - alias 直连 packages 源码 —— 组件库尚未构建也能开发,改组件即时热更
|
||||
*
|
||||
* 部署到子路径时用环境变量 NUXT_APP_BASE_URL=/docs/,不在配置里写死。
|
||||
*/
|
||||
export default defineNuxtConfig({
|
||||
extends: ['docus'],
|
||||
|
||||
// sitemap.xml、llms.txt、OG image 都依赖站点 URL,缺了会导致预渲染 500
|
||||
site: {
|
||||
url: process.env.DOCS_SITE_URL || 'https://ui.g3soft.dev',
|
||||
name: 'G3Soft UI',
|
||||
},
|
||||
|
||||
vite: {
|
||||
resolve: {
|
||||
alias: {
|
||||
'@g3soft/ui': fileURLToPath(new URL('../packages/ui/src/index.ts', import.meta.url)),
|
||||
'@g3soft/tokens': fileURLToPath(
|
||||
new URL('../packages/tokens/src/index.css', import.meta.url),
|
||||
),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
fs: {
|
||||
// 组件库源码在 docs 目录之外,需要放开读取范围
|
||||
allow: [fileURLToPath(new URL('..', import.meta.url))],
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in new issue
Block a user