1.0.3 • Published 3 years ago

@soybeanjs/router-page v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@soybeanjs/router-page

Vite 插件,自动根据页面文件生成页面的路由声明文件

用法

import { defineConfig } from 'vite';
import routerPage from '@soybeanjs/router-page';

export default defineConfig({
  plugins: [routerPage({
    dir: 'src/views', // 默认值
    excludes: ['components'], // 默认值
    dts: 'src/typings/router-page.d.ts', // 默认值
    patterns: ['index.vue'], // 默认值
    builtinRoute: { // 默认值
      root: 'root',
      notFound: 'not-found'
    },
    pagesFormatter: names =>
      names.map(name => {
        /** 系统的内置路由,该文件夹名称不作为RouteKey */
        const SYSTEM_VIEW = 'system-view_';
        return name.replace(SYSTEM_VIEW, '');
      })
  })]
});
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago