Skip to content

Commit 8e543b7

Browse files
committed
docs: update about plugin options
1 parent 393a2bd commit 8e543b7

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

README.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,26 +140,50 @@ The following html will be rendered:
140140
</div>
141141
```
142142

143-
## Options
143+
## Modifying Chunk Name
144+
145+
A chunk name from auto generated file can be conflicted with your code. You may see the below error log in that case:
146+
147+
```
148+
ERROR Failed to compile with 1 errors
149+
error in ./node_modules/vue-auto-routing/index.js
150+
It's not allowed to load an initial chunk on demand. The chunk name "index" is already used by an entrypoint.
151+
ERROR Build failed with errors.
152+
error Command failed with exit code 1.
153+
```
144154

145-
You can specify options for this plugin under `pluginOptions.autoRouting` in `vue.config.js`.
155+
To avoid this error, you can set `chunkNamePrefix` option to change the auto generated chunk name.
146156

147157
```js
148158
// vue.config.js
149159

150160
module.exports = {
151161
pluginOptions: {
152162
autoRouting: {
153-
// Specify vue-cli-plugin-auto-routing options here
163+
// Specify a prefix which will be added to all auto generated chunk name.
154164
chunkNamePrefix: 'page-'
155165
}
156166
}
157167
}
158168
```
159169

160-
The list of options is below:
170+
## Options
171+
172+
You can specify options for this plugin under `pluginOptions.autoRouting` in `vue.config.js`. The options are simply passed to `vue-auto-routing` options.
173+
You can see the available options list [here](https://github.com/ktsn/vue-route-generator#generateroutesconfig-generateconfig-string).
161174

162-
- `chunkNamePrefix`: Prefix for each route chunk name. You should change this value when your chunk conflicts with generated route chunk name.
175+
```js
176+
// vue.config.js
177+
178+
module.exports = {
179+
pluginOptions: {
180+
autoRouting: {
181+
// Specify vue-auto-routing options here
182+
nested: false
183+
}
184+
}
185+
}
186+
```
163187

164188
## Related Projects
165189

0 commit comments

Comments
 (0)