UNPKG

create-chuntianxiaozhu

Version:

春天小猪模板工具

29 lines (24 loc) 723 B
import type { Plugin } from "@ice/app/types"; import * as path from "path"; interface PluginOptions { id: string; } const plugin: Plugin<PluginOptions> = () => ({ // name 可选,插件名称 name: "plugin-login-state", // setup 必选,用于定制工程构建配置 setup: ({ generator }) => { generator.addExport({ specifier: ["withLoginState", "useLoginState"], source: path.join(__dirname, "runtime.tsx"), }); generator.addRouteTypes({ specifier: ["ConfigLoginState"], type: true, source: path.join(__dirname, "type.ts"), }); }, // runtime 可选,用于定制运行时配置 runtime: path.join(__dirname, "runtime.tsx"), }); export default plugin;