0.0.12 • Published 12 months ago

vite-plugin-vue-configurable-router v0.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

vite-plugin-vue-configurable-router

Configure your Vue Router routes in vite.config.ts with this Vite plugin.

Installation

pnpm install vite-plugin-vue-configurable-router

Usage

// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import VueConfigurableRouter from 'vite-plugin-vue-configurable-router'

export default defineConfig({
  plugins: [
    vue(),
    VueConfigurableRouter({
      routes: [
        {
          path: '/',
          component: 'Home',
        },
        {
          path: '/about',
          component: 'About',
        },
      ],
    }),
  ],
})

In your main.ts:

import { createApp } from 'vue'
import { createRouter } from 'vue-router'
import { gerRoutes } from 'vite-plugin-vue-configurable-router'
import App from './App.vue'

const router = createRouter({
  history: createWebHistory(),
  // Use the routes generated by the plugin
  routes: getRoutes(),
})
0.0.12

12 months ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago