0.1.6 • Published 5 years ago

@which-route/vue-router-reader v0.1.6

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

@which-route/vue-router-reader

  • A node tool for reading a vue program's router.

install

npm install @which-route/vue-router-reader --save / yarn add @which-route/vue-router-reader

usage

const routerReader = require('@which-route/vue-router-reader')
const dir = 'somedir'
routerReader(dir, config => {
  config.resolve.alias.set('router', path.join(dir, 'src', 'router'))
}).then((res) => {
  console.log(res)
})
  • the first argument is dir of the program which to read

  • You should use the program's webpack config which make a influence to router,you can config this with chain webpack api in the second argument.webpack chain