collect-fs-routes
This is used by Ream and similar Vue SSR / static site generator.
Install
yarn add @ream/collect-fs-routes
Usage
const { collectRoutes } = require('@ream/collect-fs-routes')
const routes = collectRoutes(options)
const routesString = renderRoutes(routes)
API
collectRoutes([options])
options.pagesDir
- Type:
string
- Default:
'pages'
The directory to page components.
options.componentPrefix
- Type:
string
- Default:
''
The path prefix for component
property in vue-router route records.
options.basePath
- Type:
string
- Default:
'/'
The base path for path
property in vue-roouter route records.
options.match
- Type:
RegExp
- Default:
/\.(vue|js)$/
The regular expression that is used to match page components.
options.statCache
- Type:
Object
- Default:
undefined
Cache of fs.stat
results.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
collect-fs-routes © EGOIST, Released under the MIT License.
Authored and maintained by EGOIST with help from contributors (list).
github.com/EGOIST · GitHub @EGOIST · Twitter @_egoistlily