Skip to content

Commit 0dc604c

Browse files
authored
feat(cli-service): provide jsconfig.json in no-ts template (#6285)
1 parent ae967f7 commit 0dc604c

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

packages/@vue/cli-service/generator/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = (api, options) => {
22
api.render('./template', {
3-
doesCompile: api.hasPlugin('babel') || api.hasPlugin('typescript')
3+
doesCompile: api.hasPlugin('babel') || api.hasPlugin('typescript'),
4+
useBabel: api.hasPlugin('babel')
45
})
56

67
if (options.vueVersion === '3') {
@@ -74,4 +75,9 @@ module.exports = (api, options) => {
7475
if (options.configs) {
7576
api.extendPackage(options.configs)
7677
}
78+
79+
// Delete jsconfig.json when typescript
80+
if (api.hasPlugin('typescript')) {
81+
api.render((files) => delete files['jsconfig.json'])
82+
}
7783
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
}

0 commit comments

Comments
 (0)