File tree Expand file tree Collapse file tree 4 files changed +12
-31
lines changed
packages/@vue/cli-service Expand file tree Collapse file tree 4 files changed +12
-31
lines changed Original file line number Diff line number Diff line change 1
- const { execa } = require ( '@vue/cli-shared-utils' )
2
-
3
1
module . exports = ( api , options ) => {
4
2
api . render ( './template' , {
5
3
doesCompile : api . hasPlugin ( 'babel' ) || api . hasPlugin ( 'typescript' )
@@ -58,39 +56,12 @@ module.exports = (api, options) => {
58
56
59
57
// for v3 compatibility
60
58
if ( options . router && ! api . hasPlugin ( 'router' ) ) {
61
- api . extendPackage ( {
62
- devDependencies : {
63
- '@vue/cli-plugin-router' : '^4.0.0'
64
- }
65
- } )
66
-
67
- api . onCreateComplete ( ( ) => {
68
- execa . sync ( 'vue' , [
69
- 'invoke' ,
70
- '@vue/cli-plugin-router' ,
71
- `--historyMode=${ options . routerHistoryMode ? 'true' : '' } `
72
- ] , {
73
- cwd : api . resolve ( '.' )
74
- } )
75
- } )
59
+ require ( './router' ) ( api , options )
76
60
}
77
61
78
62
// for v3 compatibility
79
63
if ( options . vuex && ! api . hasPlugin ( 'vuex' ) ) {
80
- api . extendPackage ( {
81
- devDependencies : {
82
- '@vue/cli-plugin-vuex' : '^4.0.0'
83
- }
84
- } )
85
-
86
- api . onCreateComplete ( ( ) => {
87
- execa . sync ( 'vue' , [
88
- 'invoke' ,
89
- '@vue/cli-plugin-vuex'
90
- ] , {
91
- cwd : api . resolve ( '.' )
92
- } )
93
- } )
64
+ require ( './vuex' ) ( api )
94
65
}
95
66
96
67
// additional tooling configurations
Original file line number Diff line number Diff line change
1
+ module . exports = ( api , options ) => {
2
+ require ( '@vue/cli-plugin-vuex/generator' ) ( api , {
3
+ historyMode : options . routerHistoryMode
4
+ } )
5
+ }
Original file line number Diff line number Diff line change
1
+ module . exports = api => {
2
+ require ( '@vue/cli-plugin-vuex/generator' ) ( api )
3
+ }
Original file line number Diff line number Diff line change 26
26
"@intervolga/optimize-cssnano-plugin" : " ^1.0.5" ,
27
27
"@soda/friendly-errors-webpack-plugin" : " ^1.7.1" ,
28
28
"@vue/cli-overlay" : " ^4.0.2" ,
29
+ "@vue/cli-plugin-router" : " ^4.0.2" ,
30
+ "@vue/cli-plugin-vuex" : " ^4.0.2" ,
29
31
"@vue/cli-shared-utils" : " ^4.0.2" ,
30
32
"@vue/component-compiler-utils" : " ^3.0.0" ,
31
33
"@vue/preload-webpack-plugin" : " ^1.1.0" ,
You can’t perform that action at this time.
0 commit comments