mirror of
https://github.com/ezolenko/rollup-plugin-typescript2.git
synced 2025-12-08 19:06:16 +00:00
- fix for formatting
This commit is contained in:
parent
ffb2c0d835
commit
62aedfe3e3
25
src/index.ts
25
src/index.ts
@ -242,19 +242,22 @@ export default function typescript(options?: Partial<IOptions>)
|
||||
printDiagnostics(contextWrapper, diagnostics, parsedConfig.options.pretty === true);
|
||||
}
|
||||
|
||||
if (result && result.dts)
|
||||
if (result)
|
||||
{
|
||||
const key = normalize(id);
|
||||
declarations[key] = result.dts;
|
||||
context.debug(() => `${blue("generated declarations")} for '${key}'`);
|
||||
result.dts = undefined;
|
||||
}
|
||||
|
||||
if (result && result.map) {
|
||||
if (pluginOptions.sourceMapCallback) {
|
||||
pluginOptions.sourceMapCallback(id, result.map);
|
||||
if (result.dts)
|
||||
{
|
||||
const key = normalize(id);
|
||||
declarations[key] = result.dts;
|
||||
context.debug(() => `${blue("generated declarations")} for '${key}'`);
|
||||
result.dts = undefined;
|
||||
}
|
||||
|
||||
if (result.map)
|
||||
{
|
||||
if (pluginOptions.sourceMapCallback)
|
||||
pluginOptions.sourceMapCallback(id, result.map);
|
||||
result.map = JSON.parse(result.map);
|
||||
}
|
||||
result.map = JSON.parse(result.map);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user