fix: types

This commit is contained in:
qiang 2020-05-14 16:55:56 +08:00
parent 5d758892c9
commit 9757681e61
3 changed files with 11 additions and 19 deletions

View File

@ -39,22 +39,13 @@ module.exports = (api, options, rootOptions) => {
'@dcloudio/uni-helper-json': '*'
},
devDependencies: {
'postcss-comment': '^2.0.0'
'postcss-comment': '^2.0.0',
'@dcloudio/types': '*',
'miniprogram-api-typings': '*',
'mini-types': '*'
}
}
})
if (options.template !== 'default-ts') {
api.extendPackage(pkg => {
return {
devDependencies: {
'@types/uni-app': '*',
'@types/html5plus': '*',
'miniprogram-api-typings': '^2.8.0-2',
'mini-types': '*'
}
}
})
}
if (options.template === 'default-ts') { // 启用 typescript
api.extendPackage(pkg => {
return {
@ -64,7 +55,6 @@ module.exports = (api, options, rootOptions) => {
},
devDependencies: {
'@babel/plugin-syntax-typescript': '^7.2.0',
'@dcloudio/types': '*',
'@vue/cli-plugin-typescript': '*',
'typescript': api.hasPlugin('eslint') ? '~3.1.1' : '^3.0.0'
}

View File

@ -10,10 +10,13 @@
"allowSyntheticDefaultImports": true,
"experimentalDecorators":true,
"sourceMap": true,
"skipLibCheck": true,
"baseUrl": ".",
"types": [
"webpack-env",
"@dcloudio/types/uni-app"
"@dcloudio/types",
"miniprogram-api-typings",
"mini-types"
],
"paths": {
"@/*": [

View File

@ -1,10 +1,9 @@
{
"compilerOptions": {
"types": [
"uni-app",
"html5plus",
"miniprogram-api-typings/types/lib.wx.api.d.ts",
"mini-types/types/api"
"@dcloudio/types",
"miniprogram-api-typings",
"mini-types"
]
}
}