@injetzhou/vite-plugin-vue-page-route
v0.0.3
Published
A vite plugin for vue, auto generate route info by page
Downloads
1
Maintainers
Readme
@injetzhou/vite-plugin-vue-page-route
A Vite plugin for vue, auto generate route info by page, include route declaration, route file import, route module const.
Usage
import { defineConfig } from 'vite';
import pageRoute from '@injetzhou/vite-plugin-vue-page-route';
export default defineConfig({
plugins: [pageRoute({
pageDir: 'src/views', // default
pageGlobs: ['**/index.{vue,tsx,jsx}', '!**/components*'], // default
routeDts: 'src/typings/page-route.d.ts', // default
routeModuleDir: 'src/router/modules', // default
routeModuleType: 'AuthRoute.Route', // default
/**
* @example _builtin_login => login
*/
routeNameTansformer: name => name.replace(/^_([a-zA-Z]|[0-9]|$)+_*/, ''), // default
lazyImport: _name => true, // default
eslintConfig: {
semicolon: false,
trailingComma: 'all',
}
})]
});