diff --git a/generator.js b/generator.js index 048bf09..cefdcc7 100644 --- a/generator.js +++ b/generator.js @@ -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' } diff --git a/template/common-ts/tsconfig.json b/template/common-ts/tsconfig.json index dfeadd6..2c77c69 100644 --- a/template/common-ts/tsconfig.json +++ b/template/common-ts/tsconfig.json @@ -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": { "@/*": [ diff --git a/template/common/tsconfig.json b/template/common/tsconfig.json index 8523776..730626d 100644 --- a/template/common/tsconfig.json +++ b/template/common/tsconfig.json @@ -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" ] } }