From 26b07115cd9239f19620356ee9c3f30c6caa8eee Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sat, 30 Oct 2021 13:54:04 +0800 Subject: [PATCH] fix: ts type error, close #4823 --- antd-tools/gulpfile.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/antd-tools/gulpfile.js b/antd-tools/gulpfile.js index fc8bd9145..71e2c4283 100644 --- a/antd-tools/gulpfile.js +++ b/antd-tools/gulpfile.js @@ -26,13 +26,14 @@ const stripCode = require('gulp-strip-code'); const compareVersions = require('compare-versions'); // const getTSCommonConfig = require('./getTSCommonConfig'); const replaceLib = require('./replaceLib'); +const getTSCommonConfig = require('./getTSCommonConfig'); const packageJson = require(getProjectPath('package.json')); const cwd = process.cwd(); const libDir = getProjectPath('lib'); const esDir = getProjectPath('es'); -// const tsConfig = getTSCommonConfig(); +const tsConfig = getTSCommonConfig(); function dist(done) { rimraf.sync(path.join(cwd, 'dist')); @@ -73,9 +74,9 @@ function dist(done) { async function compileTs(modules = false, cb) { const options = { - allowJs: true, - declaration: true, emitDeclarationOnly: true, + ...tsConfig, + moduleResolution: 2, }; const createdFiles = {}; @@ -90,6 +91,7 @@ async function compileTs(modules = false, cb) { 'components/**/*.jsx', 'components/**/*.tsx', 'components/**/*.ts', + 'typings/**/*.d.ts', '!components/*/__tests__/*', '!components/*/style/*', '!components/styles.ts',