Skip to content

CCherry07/vite-plugin-auto-route

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-plugin-auto-route

A vite plugin for auto generate route.

Install

npm i vite-plugin-auto-route -D

Usage

// vite.config.js
import { defineConfig } from "vite";
import vue from '@vitejs/plugin-vue'
import VitePluginAutoRoute from "vite-plugin-auto-route";
export default defineConfig({
  plugins: [
    vue(),
    VitePluginAutoRoute({
      pagesDir: "src/pages",
      routesDir: "src/router",
    })
  ]
});

Options

Name Type Default Description
pagesDir string src/pages The directory where the page is located
routesDir string src/router The directory where the route is located
templatePath string index.vue The file name of the page
getFilesInfo string /files/info Get the file information under pagesDir API
postRoute string /add/route Add route API

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published