主题
selrux.config.ts
唯一用户配置入口。必须默认导出普通对象。
ts
import { defineConfig } from '@vlian/app';
export default defineConfig({
// shell: true,
vite: {
base: '/',
server: { port: 8000 },
build: { sourcemap: false },
},
});defineConfig
| 项 | 说明 |
|---|---|
| 导入 | import { defineConfig } from '@vlian/app' |
| 环境 | Node(配置文件) |
| 行为 | 类型辅助;运行时原样返回,导入时无副作用 |
| 签名 | (config?: DefineConfigInput) => SelruxUserConfig |
SelruxUserConfig
| 字段 | 类型 | 默认 | 说明 |
|---|---|---|---|
shell | boolean | false | true 时启用 @selrux/shell |
vite | SelruxViteUserConfig | — | 透传 Vite 子集 |
禁止编造顶层 theme / tabs / routes / auth。布局走文件约定。
Vite 规则
| 规则 | 说明 |
|---|---|
| 保留字段 | 不可设 root、configFile、build.rollupOptions.input、build.rolldownOptions.input |
alias @ | 固定指向 src,不可重定义 |
base | 仅绝对路径前缀(/、/console/) |
| 形态 | 不支持函数/异步/多环境文件/继承 |
相关类型
ResolvedSelruxConfig / ResolvedSelruxViteConfig 为规范化内部结果,主要由 CLI 与生成流程消费。