This is used by Ream and similar Vue SSR / static site generator.
yarn add @ream/collect-fs-routesconst { collectRoutes } = require('@ream/collect-fs-routes')
const routes = collectRoutes(options)
const routesString = renderRoutes(routes)- Type:
string - Default:
'pages'
The directory to page components.
- Type:
string - Default:
''
The path prefix for component property in vue-router route records.
- Type:
string - Default:
'/'
The base path for path property in vue-roouter route records.
- Type:
RegExp - Default:
/\.(vue|js)$/
The regular expression that is used to match page components.
- Type:
Object - Default:
undefined
Cache of fs.stat results.
- 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
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