UNPKG

@difizen/umi-plugin-mana

Version:

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

37 lines (35 loc) 1.45 kB
var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/decorator.ts var decorator_exports = {}; __export(decorator_exports, { default: () => decorator_default }); module.exports = __toCommonJS(decorator_exports); var decorator_default = (api) => { 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" ]; }); };