20261008173212

This commit is contained in:
oneao committed 2026-10-08 17:32:12 +08:00
1 parent ac65b75c73
commit f572dce2f6
48 files changed
+1698 -507

No files matched your search

+16 -6
View File
@@ -6,6 +6,7 @@ import { fileURLToPath } from 'node:url'
* 几个刻意的选择:
* - extends: ['docus'] —— Docus 是 Nuxt Layer,全部能力(导航、搜索、主题)由它提供
* - alias 直连 packages 源码 —— 组件库尚未构建也能开发,改组件即时热更
* (tokens 例外:它是 SCSS 编译产物,alias 指向 dist/index.css,需先 build tokens)
*
* 部署到子路径时用环境变量 NUXT_APP_BASE_URL=/docs/,不在配置里写死。
*/
@@ -27,12 +28,21 @@ export default defineNuxtConfig({
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),
),
},
// 用正则做“精确匹配”:否则 '@g3soft/tokens' 的前缀别名会把
// '@g3soft/tokens/scss' 也一并改写掉,导致组件里的 @use 找不到 SCSS。
alias: [
{
find: /^@g3soft\/ui$/,
replacement: fileURLToPath(new URL('../packages/ui/src/index.ts', import.meta.url)),
},
{
// tokens 是 SCSS 编译产物:仅裸导入指向 dist/index.css(由 @g3soft/tokens 的 build 生成)
find: /^@g3soft\/tokens$/,
replacement: fileURLToPath(
new URL('../packages/tokens/dist/index.css', import.meta.url),
),
},
],
},
server: {
fs: {