Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edivados/vite-plugin-solid-filesystem-router
SolidStart's filesystem router as standalone Vite plugin intended for use in single page application (SPA).
https://github.com/edivados/vite-plugin-solid-filesystem-router
file-system-router filesystem filesystem-router plugin router solid solid-js solid-router solidjs vite-plugin vitejs
Last synced: 6 days ago
JSON representation
SolidStart's filesystem router as standalone Vite plugin intended for use in single page application (SPA).
- Host: GitHub
- URL: https://github.com/edivados/vite-plugin-solid-filesystem-router
- Owner: edivados
- Created: 2024-06-29T23:34:55.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-22T17:24:19.000Z (13 days ago)
- Last Synced: 2024-12-22T18:26:33.168Z (13 days ago)
- Topics: file-system-router, filesystem, filesystem-router, plugin, router, solid, solid-js, solid-router, solidjs, vite-plugin, vitejs
- Language: JavaScript
- Homepage:
- Size: 104 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vite Plugin Solid Filesystem Router
SolidStart's filesystem router as standalone Vite plugin intended for use in single page application (SPA).
Implementation taken from [SolidStart](https://github.com/solidjs/solid-start) and [Vinxi](https://github.com/nksaraf/vinxi).
## Installation
```
npm install @edivados/vite-plugin-solid-filesystem-router
```## Usage
```ts
import { defineConfig } from "vite";
import solid from "vite-plugin-solid";
import solidFilesystemRouter from "@edivados/vite-plugin-solid-filesystem-router";export default defineConfig({
plugins: [
solid(),
solidFilesystemRouter()
]
});
```## Options
### options
- Type: Object
- Default: {}#### options.dir
- Type: string
- Default: 'src/routes'Directory where to look for route files.
#### options.extensions
- Type: string[]
- Default: ['jsx', 'tsx']An array of file extensions to be picked up as routes. By defualt only `jsx` and `tsx` are picked up.
#### options.router
- Type: BaseFileSystemRouter
- Defualt: undefinedCustom filesystem router implementation. `dir` and `extensions` option will be ignored if present. For more information see [Vinxi](https://vinxi.vercel.app/guide/file-system-routing.html) and [SolidStart](https://github.com/solidjs/solid-start/blob/main/packages/start/config/fs-router.js).