diff --git a/src/esmExports.ts b/src/esmExports.ts index 8c7adfb..127bd4e 100644 --- a/src/esmExports.ts +++ b/src/esmExports.ts @@ -30,7 +30,7 @@ const preprocess = (text: string): string => return `[${JSON.stringify( p2.trim(), )}]=${p1}`; - }) + }) : `[${JSON.stringify(e.trim())}]=${e}`), ) .join(';'); diff --git a/src/esmImports.ts b/src/esmImports.ts index 142e24a..9b32ad8 100644 --- a/src/esmImports.ts +++ b/src/esmImports.ts @@ -31,7 +31,7 @@ const preprocess = (text: string): string => : '', namedImports?.replace(/as\s/g, ':'), starName ? `...${starName}` : '', - ] + ] .filter(Boolean) .join(',')}}=` : '' @@ -51,7 +51,7 @@ const preprocess = (text: string): string => return `[${JSON.stringify( p2.trim(), )}]=${p1}`; - }) + }) : `[${JSON.stringify(e.trim())}]=${e}`), ) .join(';');