From 0df89d09b2122b9f8661f902295d2b735e36bb29 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Tue, 14 Sep 2021 14:24:22 +0800 Subject: [PATCH] fix(tsbb): Fix type output error. --- package.json | 1 + packages/tsbb/src/cli.ts | 2 -- packages/tsbb/src/utils/compile.ts | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4778ac10..13c7501c 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "watch:react-component": "lerna exec \"npm run watch\" --scope @template/react-component", "start:react-component": "lerna exec \"npm run doc:dev\" --scope @template/react-component", "build:react-component-tsx": "lerna exec \"npm run build\" --scope @template/react-component-tsx", + "watch:react-component-tsx": "lerna exec \"npm run watch\" --scope @template/react-component-tsx", "watch": "lerna exec \"tsc -p ./ --types --outDir lib --watch\" --scope tsbb", "build": "lerna exec \"tsc -p ./ --types --outDir lib\" --scope create-tsbb --scope tsbb --stream", "type-check": "lerna exec \"tsc --noEmit\" --scope create-tsbb --scope tsbb --stream", diff --git a/packages/tsbb/src/cli.ts b/packages/tsbb/src/cli.ts index bbf84e44..408859d4 100644 --- a/packages/tsbb/src/cli.ts +++ b/packages/tsbb/src/cli.ts @@ -57,8 +57,6 @@ const argv: ArgvArguments = parser(process.argv.slice(2), { argv.fileNames = [argv.entry]; } - argv.fileNames = argv.fileNames.map((item) => item.replace(/\.tsx$/, '.ts')); - if (argv.disableBabel) { argv.esm = false; } diff --git a/packages/tsbb/src/utils/compile.ts b/packages/tsbb/src/utils/compile.ts index fd57f62c..a720d5ee 100644 --- a/packages/tsbb/src/utils/compile.ts +++ b/packages/tsbb/src/utils/compile.ts @@ -68,6 +68,7 @@ export async function compile( resolve(); return; } + tsOptions.noEmit = false; const host = ts.createCompilerHost(tsOptions, true); // ts.getParsedCommandLineOfConfigFile('', tsOptions, host)