File tree 2 files changed +26
-1
lines changed
packages/@vue/cli-service/generator
2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1
1
module . exports = ( api , options ) => {
2
2
api . render ( './template' , {
3
- doesCompile : api . hasPlugin ( 'babel' ) || api . hasPlugin ( 'typescript' )
3
+ doesCompile : api . hasPlugin ( 'babel' ) || api . hasPlugin ( 'typescript' ) ,
4
+ useBabel : api . hasPlugin ( 'babel' )
4
5
} )
5
6
6
7
if ( options . vueVersion === '3' ) {
@@ -74,4 +75,9 @@ module.exports = (api, options) => {
74
75
if ( options . configs ) {
75
76
api . extendPackage ( options . configs )
76
77
}
78
+
79
+ // Delete jsconfig.json when typescript
80
+ if ( api . hasPlugin ( 'typescript' ) ) {
81
+ api . render ( ( files ) => delete files [ 'jsconfig.json' ] )
82
+ }
77
83
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "target" : " <%- options.useBabel ? 'esnext' : 'es5' %>" ,
4
+ "module" : " esnext" ,
5
+ "baseUrl" : " ./" ,
6
+ "moduleResolution" : " node" ,
7
+ "paths" : {
8
+ "@/*" : [
9
+ " src/*"
10
+ ]
11
+ },
12
+ "lib" : [
13
+ " esnext" ,
14
+ " dom" ,
15
+ " dom.iterable" ,
16
+ " scripthost"
17
+ ]
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments