0.6.0 • Published 5 months ago

@yme/lay-router v0.6.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

@yme/lay-router

generate page routes

example

// vite.config.ts
import layRouter from '@yme/lay-router/vite';

export default defineConfig({
  plugins: [
    // ...
    // define in vite
    layRouter()
    // ...
  ]
});

And run the development server

pnpm dev

directories

src
- pages
  - users
    - page.tsx
  - dashboard
    - analytics
      - page.tsx
- layouts
  - root
    - layout.tsx
  - basic
    - layout.tsx

Then you can see the generated routes in src/pages/index.ts and src/layouts/index.ts

// src/pages/index.ts
export const pages = [
  ...
  {
    slug: '/foo/bar/zoo',
    path: 'foo/bar/zoo',
    component: __component_1__
  },
  ...
];

// src/layouts/index.ts
export const layouts = {
  root,
  ...
};

Recommended for use with @yme/lay-router-react

License

MIT

0.5.2

5 months ago

0.6.0

5 months ago

0.5.1

7 months ago

0.5.0

7 months ago

0.4.2

7 months ago

0.4.1

7 months ago

0.4.0

7 months ago

0.3.0

7 months ago

0.2.2

7 months ago

0.2.1

7 months ago

0.2.0

7 months ago

0.1.1

7 months ago

0.1.0

7 months ago

0.0.1

7 months ago