@alitajs/routes
TypeScript icon, indicating that this package has built-in type declarations

2.9.0 • Public • Published

@alitajs/routes

routes modification plugin for umi.

Usage

Install via yarn or npm.

$ yarn add @umijs/plugin-routes

Configure it in the .umirc.js.

export default {
   plugins: ['@umijs/plugin-routes'],
   routesExtend: {
     exclude: [],
     update:(routes) => {
        return routes;
     }
   }
}

routesExtend

routesExtend.exclude

type: Array(RegExp|Function)

e.g.

{
  exclude: [
    // exclude all the `models` directory
    /models\//,
    // exclude ./pages/a.js
    (route) { return route.component === './pages/a.js' },
  ],
}

routesExtend.update

type: Function

e.g.

{
  update(routes) {
    return [
      { path: '/foo', component: './bar.js' },
      ...routes,
    ];
  }
}

Readme

Keywords

Package Sidebar

Install

npm i @alitajs/routes

Weekly Downloads

122

Version

2.9.0

License

MIT

Unpacked Size

5.57 kB

Total Files

4

Last publish

Collaborators

  • pengyh
  • ashoka_j
  • diyc
  • xiaohuoni
  • imhele
  • wangxingkang
  • shawdanon
  • cjy0208
  • sorrycc
  • hang1017
  • hammersjs