@ream/collect-fs-routes
Collect routes from file system for vue-router.
Last updated 2 years ago by rem .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ream/collect-fs-routes 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.2                                ...           latest (2 years ago)

4 Versions

  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (3)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |