umi-plugin-routes

1.8.9 • Public • Published

umi-plugin-routes

routes modification plugin for umi.


Suggest to use together with umi-plugin-react, see our website umi-plugin-react for more.


Usage

Install via yarn or npm.

$ yarn add umi-plugin-routes

Configure it in the .umirc.js.

export default {
  plugins: [['umi-plugin-routes', option]],
};

Option

option.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' },
  ],
}

option.update

type: Function

e.g.

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

Readme

Keywords

none

Package Sidebar

Install

npm i umi-plugin-routes

Weekly Downloads

1,216

Version

1.8.9

License

MIT

Unpacked Size

8.04 kB

Total Files

7

Last publish

Collaborators

  • sorrycc
  • yutingzhao1991