You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-5Lines changed: 29 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -140,26 +140,50 @@ The following html will be rendered:
140
140
</div>
141
141
```
142
142
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
+
```
144
154
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.
146
156
147
157
```js
148
158
// vue.config.js
149
159
150
160
module.exports= {
151
161
pluginOptions: {
152
162
autoRouting: {
153
-
// Specify vue-cli-plugin-auto-routing options here
163
+
// Specify a prefix which will be added to all auto generated chunk name.
154
164
chunkNamePrefix:'page-'
155
165
}
156
166
}
157
167
}
158
168
```
159
169
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).
161
174
162
-
-`chunkNamePrefix`: Prefix for each route chunk name. You should change this value when your chunk conflicts with generated route chunk name.
0 commit comments