File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { emitDts } from './tsc';
6
6
import { ensureTempDeclarationDir , loadTsconfig } from './utils' ;
7
7
8
8
export async function generateDts ( data : DtsGenOptions ) {
9
- logger . info ( 'Generating DTS...' ) ;
9
+ logger . start ( 'Generating DTS...' ) ;
10
10
const { options : pluginOptions , cwd, isWatch } = data ;
11
11
const { tsconfigPath, distPath, bundle, entryPath } = pluginOptions ;
12
12
const configPath = ts . findConfigFile ( cwd , ts . sys . fileExists , tsconfigPath ) ;
Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ export function emitDts(
14
14
onComplete : ( isSuccess : boolean ) => void ,
15
15
isWatch = false ,
16
16
) {
17
+ const start = Date . now ( ) ;
18
+ const getTimeCost = ( ) => {
19
+ return `${ Math . floor ( Date . now ( ) - start ) } ms` ;
20
+ } ;
17
21
const { configPath, declarationDir } = options ;
18
22
const { options : rawCompilerOptions , fileNames } = loadTsconfig ( configPath ) ;
19
23
@@ -58,10 +62,10 @@ export function emitDts(
58
62
logger . error ( message ) ;
59
63
}
60
64
61
- throw new Error ( 'TypeScript compilation failed' ) ;
65
+ throw new Error ( 'DTS generation failed' ) ;
62
66
}
63
67
64
- logger . info ( 'TypeScript compilation succeeded\n' ) ;
68
+ logger . info ( `DTS generation succeeded in ${ getTimeCost ( ) } ` ) ;
65
69
} else {
66
70
const createProgram = ts . createSemanticDiagnosticsBuilderProgram ;
67
71
const formatHost : ts . FormatDiagnosticsHost = {
You can’t perform that action at this time.
0 commit comments