fix: ts type error, close #4823
parent
fdc2012b90
commit
26b07115cd
|
@ -26,13 +26,14 @@ const stripCode = require('gulp-strip-code');
|
||||||
const compareVersions = require('compare-versions');
|
const compareVersions = require('compare-versions');
|
||||||
// const getTSCommonConfig = require('./getTSCommonConfig');
|
// const getTSCommonConfig = require('./getTSCommonConfig');
|
||||||
const replaceLib = require('./replaceLib');
|
const replaceLib = require('./replaceLib');
|
||||||
|
const getTSCommonConfig = require('./getTSCommonConfig');
|
||||||
|
|
||||||
const packageJson = require(getProjectPath('package.json'));
|
const packageJson = require(getProjectPath('package.json'));
|
||||||
const cwd = process.cwd();
|
const cwd = process.cwd();
|
||||||
const libDir = getProjectPath('lib');
|
const libDir = getProjectPath('lib');
|
||||||
const esDir = getProjectPath('es');
|
const esDir = getProjectPath('es');
|
||||||
|
|
||||||
// const tsConfig = getTSCommonConfig();
|
const tsConfig = getTSCommonConfig();
|
||||||
|
|
||||||
function dist(done) {
|
function dist(done) {
|
||||||
rimraf.sync(path.join(cwd, 'dist'));
|
rimraf.sync(path.join(cwd, 'dist'));
|
||||||
|
@ -73,9 +74,9 @@ function dist(done) {
|
||||||
|
|
||||||
async function compileTs(modules = false, cb) {
|
async function compileTs(modules = false, cb) {
|
||||||
const options = {
|
const options = {
|
||||||
allowJs: true,
|
|
||||||
declaration: true,
|
|
||||||
emitDeclarationOnly: true,
|
emitDeclarationOnly: true,
|
||||||
|
...tsConfig,
|
||||||
|
moduleResolution: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
const createdFiles = {};
|
const createdFiles = {};
|
||||||
|
@ -90,6 +91,7 @@ async function compileTs(modules = false, cb) {
|
||||||
'components/**/*.jsx',
|
'components/**/*.jsx',
|
||||||
'components/**/*.tsx',
|
'components/**/*.tsx',
|
||||||
'components/**/*.ts',
|
'components/**/*.ts',
|
||||||
|
'typings/**/*.d.ts',
|
||||||
'!components/*/__tests__/*',
|
'!components/*/__tests__/*',
|
||||||
'!components/*/style/*',
|
'!components/*/style/*',
|
||||||
'!components/styles.ts',
|
'!components/styles.ts',
|
||||||
|
|
Loading…
Reference in New Issue