Skip to content

Commit 7562737

Browse files
authored
feat: pass all options from vue.config to vue-auto-routing (#26)
Fixes #25
1 parent 935c27e commit 7562737

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

index.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
const VueAutoRoutingPlugin = require('vue-auto-routing/lib/webpack-plugin')
22

3-
module.exports = (api, options) => {
4-
const opts =
5-
(options.pluginOptions && options.pluginOptions.autoRouting) || {}
3+
const defaultOptions = {
4+
pages: 'src/pages',
5+
nested: true,
6+
}
67

8+
module.exports = (api, options) => {
79
const pluginOptions = {
8-
pages: 'src/pages',
9-
nested: true
10-
}
11-
12-
if (opts.chunkNamePrefix != null) {
13-
pluginOptions.chunkNamePrefix = opts.chunkNamePrefix
10+
...defaultOptions,
11+
...(options.pluginOptions && options.pluginOptions.autoRouting),
1412
}
1513

1614
api.chainWebpack(webpackConfig => {

0 commit comments

Comments
 (0)