From ea3c35d2c668448910b7be49281d20a35d38b33a Mon Sep 17 00:00:00 2001 From: qiang Date: Mon, 22 Aug 2022 18:31:30 +0800 Subject: [PATCH] feat: update ts deps version --- generator.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generator.js b/generator.js index 25b9d7d..3e31fbe 100644 --- a/generator.js +++ b/generator.js @@ -57,6 +57,7 @@ module.exports = (api, options, rootOptions) => { }) if (options.template === 'default-ts') { // 启用 typescript api.extendPackage(pkg => { + const isV4 = api.cliVersion.split('.')[0] === '4' return { dependencies: { 'vue-class-component': '^6.3.2', @@ -64,8 +65,8 @@ module.exports = (api, options, rootOptions) => { }, devDependencies: { '@babel/plugin-syntax-typescript': '^7.2.0', - '@vue/cli-plugin-typescript': '~4.5.11', - 'typescript': api.hasPlugin('eslint') ? '~3.1.1' : '^3.0.0' + '@vue/cli-plugin-typescript': '~' + api.cliServiceVersion, + 'typescript': isV4 ? '~4.1.5' : '~4.5.5' } } })