File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -242,19 +242,22 @@ export default function typescript(options?: Partial<IOptions>)
242242 printDiagnostics ( contextWrapper , diagnostics , parsedConfig . options . pretty === true ) ;
243243 }
244244
245- if ( result && result . dts )
245+ if ( result )
246246 {
247- const key = normalize ( id ) ;
248- declarations [ key ] = result . dts ;
249- context . debug ( ( ) => `${ blue ( "generated declarations" ) } for '${ key } '` ) ;
250- result . dts = undefined ;
251- }
247+ if ( result . dts )
248+ {
249+ const key = normalize ( id ) ;
250+ declarations [ key ] = result . dts ;
251+ context . debug ( ( ) => `${ blue ( "generated declarations" ) } for '${ key } '` ) ;
252+ result . dts = undefined ;
253+ }
252254
253- if ( result && result . map ) {
254- if ( pluginOptions . sourceMapCallback ) {
255- pluginOptions . sourceMapCallback ( id , result . map ) ;
255+ if ( result . map )
256+ {
257+ if ( pluginOptions . sourceMapCallback )
258+ pluginOptions . sourceMapCallback ( id , result . map ) ;
259+ result . map = JSON . parse ( result . map ) ;
256260 }
257- result . map = JSON . parse ( result . map ) ;
258261 }
259262
260263 return result ;
You can’t perform that action at this time.
0 commit comments