UNPKG

@difizen/umi-plugin-mana

Version:

- 支持 decorator 所需的 babel 配置,在 typescript 4 环境生效 - 支持动态路由路径 - 支持 nodenext,在 import path 中允许增加扩展名 - 支持 mana 运行时能力,基于 slot 的路由等

22 lines (19 loc) 482 B
import type { IApi } from 'umi'; /** * support dynamic router base * window.routerBase */ export default (api: IApi) => { api.addRuntimePlugin(() => ['../plugin-routerBase/runtime.ts']); api.addRuntimePluginKey(() => ['routerBase']); api.onGenerateFiles(() => { api.writeTmpFile({ path: '../plugin-routerBase/runtime.ts', content: ` export function modifyContextOpts(memo: any) { return { ...memo, basename: window.routerBase }; }; `, }); }); };