File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ class PluginAPI {
41
41
* @return {boolean }
42
42
*/
43
43
hasPlugin ( id ) {
44
+ if ( id === 'router' ) id = 'vue-router'
45
+ if ( [ 'vue-router' , 'vuex' ] . includes ( id ) ) {
46
+ const pkg = this . service . pkg
47
+ return ( ( pkg . dependencies && pkg . dependencies [ id ] ) || ( pkg . devDependencies && pkg . devDependencies [ id ] ) )
48
+ }
44
49
return this . service . plugins . some ( p => matchesPluginId ( id , p . id ) )
45
50
}
46
51
Original file line number Diff line number Diff line change @@ -374,6 +374,7 @@ class PluginApi {
374
374
* @param {string } id Plugin id or short id
375
375
*/
376
376
hasPlugin ( id ) {
377
+ if ( id === 'router' ) id = 'vue-router'
377
378
if ( [ 'vue-router' , 'vuex' ] . includes ( id ) ) {
378
379
const pkg = folders . readPackage ( this . cwd , this . context , true )
379
380
return ( ( pkg . dependencies && pkg . dependencies [ id ] ) || ( pkg . devDependencies && pkg . devDependencies [ id ] ) )
Original file line number Diff line number Diff line change @@ -213,6 +213,11 @@ module.exports = class Generator {
213
213
}
214
214
215
215
hasPlugin ( _id ) {
216
+ if ( _id === 'router' ) _id = 'vue-router'
217
+ if ( [ 'vue-router' , 'vuex' ] . includes ( _id ) ) {
218
+ const pkg = this . pkg
219
+ return ( ( pkg . dependencies && pkg . dependencies [ _id ] ) || ( pkg . devDependencies && pkg . devDependencies [ _id ] ) )
220
+ }
216
221
return [
217
222
...this . plugins . map ( p => p . id ) ,
218
223
...Object . keys ( this . pkg . devDependencies || { } ) ,
You can’t perform that action at this time.
0 commit comments