@ream/collect-fs-routes

1.0.2 • Public • Published

collect-fs-routes

NPM version NPM downloads CircleCI

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

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. 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

Readme

Keywords

none

Package Sidebar

Install

npm i @ream/collect-fs-routes

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

7.18 kB

Total Files

4

Last publish

Collaborators

  • egoist
  • kchan
  • rem