From 128febf0eac7f9dbe1efab41224d359e7159f234 Mon Sep 17 00:00:00 2001 From: AlCalzone Date: Mon, 13 Sep 2021 00:27:59 +0200 Subject: [PATCH] fix loading Node.js typings --- lib/typescriptTools.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/typescriptTools.js b/lib/typescriptTools.js index 31461b6b8..2b08c43d0 100644 --- a/lib/typescriptTools.js +++ b/lib/typescriptTools.js @@ -90,7 +90,7 @@ function resolveTypings(pkg, wrapInDeclareModule) { const ret = {}; // We need to look at `import/export ... from 'modulename'` and `/// ` - const importDtsRegex = /(?:import|export) .+ from ["'](\.+\/[^"']+)["']/g; + const importDtsRegex = /^\s*(?:import|export) .+ from ["'](\.+\/[^"']+)["']/g; const pathReferenceRegex = /\/\/\/ /g; const matchAllImports = string => [ ...matchAll(importDtsRegex, string),