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 {
4141 * @return {boolean }
4242 */
4343 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+ }
4449 return this . service . plugins . some ( p => matchesPluginId ( id , p . id ) )
4550 }
4651
Original file line number Diff line number Diff line change @@ -374,6 +374,7 @@ class PluginApi {
374374 * @param {string } id Plugin id or short id
375375 */
376376 hasPlugin ( id ) {
377+ if ( id === 'router' ) id = 'vue-router'
377378 if ( [ 'vue-router' , 'vuex' ] . includes ( id ) ) {
378379 const pkg = folders . readPackage ( this . cwd , this . context , true )
379380 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 {
213213 }
214214
215215 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+ }
216221 return [
217222 ...this . plugins . map ( p => p . id ) ,
218223 ...Object . keys ( this . pkg . devDependencies || { } ) ,
You can’t perform that action at this time.
0 commit comments