Skip to content

Commit

Permalink
feat: pass all options from vue.config to vue-auto-routing (#26)
Browse files Browse the repository at this point in the history
Fixes #25
  • Loading branch information
IlyaSemenov authored Feb 9, 2020
1 parent 935c27e commit 7562737
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
const VueAutoRoutingPlugin = require('vue-auto-routing/lib/webpack-plugin')

module.exports = (api, options) => {
const opts =
(options.pluginOptions && options.pluginOptions.autoRouting) || {}
const defaultOptions = {
pages: 'src/pages',
nested: true,
}

module.exports = (api, options) => {
const pluginOptions = {
pages: 'src/pages',
nested: true
}

if (opts.chunkNamePrefix != null) {
pluginOptions.chunkNamePrefix = opts.chunkNamePrefix
...defaultOptions,
...(options.pluginOptions && options.pluginOptions.autoRouting),
}

api.chainWebpack(webpackConfig => {
Expand Down

0 comments on commit 7562737

Please sign in to comment.