feat: add writeToDisk option for dev server support

- Add writeToDisk option to write .d.ts files directly to disk
- Useful for rsbuild/rspack dev server which uses in-memory FS
- Set writeToDisk: true in dev mode to see generated types

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
hyper
2026-03-31 15:54:38 +08:00
co-authored by Qwen-Coder
parent 377a47e49f
commit 525ae262fd
6 changed files with 39 additions and 5 deletions
+2
View File
@@ -43,6 +43,7 @@ module.exports = {
trim: true, // 修剪表头和值的前后空格 (默认 true)
// emitTypes: false, // 禁用类型定义生成 (默认 true)
// typesOutputDir: 'types', // 类型文件输出目录 (可选)
// writeToDisk: true, // 在 dev server 下写入磁盘 (默认 false)
},
},
},
@@ -96,6 +97,7 @@ import type { RowType } from './data.schema.csv';
| `trim` | boolean | `true` | Trim headers and values |
| `emitTypes` | boolean | `true` | Generate TypeScript declaration file (.d.ts) |
| `typesOutputDir` | string | `''` | Output directory for generated type files (relative to output path) |
| `writeToDisk` | boolean | `false` | Write .d.ts files directly to disk (useful for dev server) |
## Schema Syntax