@difizen/umi-plugin-mana
Version:
- 支持 decorator 所需的 babel 配置,在 typescript 4 环境生效 - 支持动态路由路径 - 支持 nodenext,在 import path 中允许增加扩展名 - 支持 mana 运行时能力,基于 slot 的路由等
18 lines (16 loc) • 586 B
text/typescript
import type { IApi } from 'umi';
/**
* support decorator, using for typescript 4
*/
export default (api: IApi) => {
api.addExtraBabelPlugins(() => {
return [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-transform-flow-strip-types', { allowDeclareFields: true }],
['@babel/plugin-transform-class-properties', { loose: true }],
['@babel/plugin-transform-private-methods', { loose: true }],
['@babel/plugin-transform-private-property-in-object', { loose: true }],
'babel-plugin-parameter-decorator',
];
});
};