From 15ad866de2bfcaa278197b5eef52452d63ed6aef Mon Sep 17 00:00:00 2001 From: Damian Bielecki Date: Thu, 2 May 2019 12:49:10 +0200 Subject: [PATCH] Preserve "declare" modifier for `outputAsModuleFolder : true` --- lib/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.ts b/lib/index.ts index 6e744c4..365889b 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -762,7 +762,7 @@ export function bundle(options: Options): BundleResult { let [_, sp, static1, pub, static2, ident] = match; line = sp + static1 + static2 + ident; } - if (inSourceTypings(file)) { + if (inSourceTypings(file) && !outputAsModuleFolder) { // for internal typings, remove the 'declare' keyword (but leave 'export' intact) res.lines.push({ original: line.replace(/^(export )?declare /g, '$1') }); }