From 7562737b860fcf394175f8f7b7eed30dd3ed6869 Mon Sep 17 00:00:00 2001 From: Ilya Semenov Date: Sun, 9 Feb 2020 17:23:53 +0700 Subject: [PATCH] feat: pass all options from vue.config to vue-auto-routing (#26) Fixes https://github.com/ktsn/vue-cli-plugin-auto-routing/issues/25 --- index.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 0af179b..9dd734c 100644 --- a/index.js +++ b/index.js @@ -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 => {