2.0.10 • Published 3 years ago

vue-router-extract-plugin v2.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

build status

vue-router-extract-plugin

This plugin extracts vue-router route path and title into new file.

Getting Started

To begin, you'll need to install vue-router-extrace-plugin:

use npm

npm install --save-dev vue-router-extract-plugin

use yarn

yarn add -D vue-router-extract-plugin

Options

NameTypeDefaultDescription
projectName{String}'default'This option determines the name of window object attribute
inputFileDir{String} ''This option determines the dir of source file
outputFileName{String} 'routemap.js'This option determines the fileName of output file

projectName

Type: String Default: window['default-routemap'] This option determines the name of window object attribute

inputFileDir

Type: String Default: '' This option determines the dir of source file

outputFileName

Type: String Default: 'routemap.js' This option determines the fileName of output file

Examples

// source dir ./src/router/modules/quotes.js
const routes = [
    {
        name: 'goods-manage',
        path: '/goods-manage',
        component: () => import('@/pages/views/quotes/goods/index.vue'),
        meta: { title: 'goods' }
    }
]
export default routes
// ./vue.config.js
const VueRouterExtractPlugin = require('vue-router-extract-plugin')

const config = {
configureWebpack: {
        // plugins config
        plugins: [
            new VueRouterExtractPlugin({
                projectName: 'app',
                inputFileDir: resolve('../src/router/modules/*.js')
            })
        ]
    },
}
// output file routemap.js content
window['app-routemap'] = {
    "path: '/goods-manage'": "'goods'",
}

License

MIT

2.0.9

3 years ago

2.0.10

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.6

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago