From 3d1996ee0ab53cf7c9a6706fea44bdebcde354c1 Mon Sep 17 00:00:00 2001 From: jason lim <50891910+Sxxov@users.noreply.github.com> Date: Sun, 29 Oct 2023 21:52:58 +0800 Subject: [PATCH] More robust spacing parsing in helper --- src/helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helper.ts b/src/helper.ts index 3827f8a..5371352 100644 --- a/src/helper.ts +++ b/src/helper.ts @@ -16,7 +16,7 @@ export default ({ enabled = true } = {}) => { transform(src: string, _: string) { let curr: RegExpExecArray | null = null; const regex = - /import +{(?(?:[^}{])*)} +from +["'](?maic)(?:\/(?\w+))?["'];?/dg; + /import\s+{(?(?:[^}{])*)}\s+from\s+["'](?maic)(?:\/(?\w+))?["'];?/dg; let dist = ''; let prevIndex = 0;