进阶
Bundle 模式:多文件插件
Bundle 模式:多文件插件 — 学习如何构建进阶 dsh 插件。
多文件插件
当插件增长时,单个 index.ts 会变得臃肿。拆成多个文件,让 dsh.bundle.patch 指向入口:
{
"dsh": { "bundle": { "patch": ["dist/index.js"] } }
}用 TypeScript 构建项目,输出到 dist/,分发编译后的 JS。source map 是可选的,但对调试有帮助。
Bundle 模式:多文件插件 — 学习如何构建进阶 dsh 插件。
当插件增长时,单个 index.ts 会变得臃肿。拆成多个文件,让 dsh.bundle.patch 指向入口:
{
"dsh": { "bundle": { "patch": ["dist/index.js"] } }
}用 TypeScript 构建项目,输出到 dist/,分发编译后的 JS。source map 是可选的,但对调试有帮助。