feat!: make router a separate plugin (#4196)

* refactor: move router to its own plugin

* refactor: rename routerHistoryMode option to historyMode

* test: add @vue/cli-plugin-router tests

* feat: change src/router.js for most common use cases

* fix: fix cli-ui tests

* docs: Remove router root option from docs

* fix: add support for legacy router option
This commit is contained in:
Pavan Kumar Sunkara
2019-07-05 17:21:29 +02:00
committed by Haoqun Jiang
parent 9eadfe1eba
commit 246ae678cb
33 changed files with 305 additions and 187 deletions

View File

@@ -1274,7 +1274,7 @@ const ROUTER = 'vue-router-add'
api.onViewOpen(({ view }) => {
if (view.id === 'vue-project-plugins') {
if (!api.hasPlugin('vue-router')) {
if (!api.hasPlugin('router')) {
api.addSuggestion({
id: ROUTER,
type: 'action',
@@ -1282,7 +1282,7 @@ api.onViewOpen(({ view }) => {
message: 'org.vue.cli-service.suggestions.vue-router-add.message',
link: 'https://router.vuejs.org/',
async handler () {
await install(api, 'vue-router')
await install(api, 'router')
}
})
}