Skip to content

Commit 42e4cc2

Browse files
committed
fix stripExports function
1 parent dda5c40 commit 42e4cc2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/lib/components/ImportFunction.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
export function stripExports(code: string): string {
22
return code
3-
.replace(/export\s+(default\s+)?/g, "") // export文を削除
4-
.replace(/export\s*\{[^}]*\}\s*from\s*['"][^'"]*['"]\s*;?/g, "") // export {...} from を削除
3+
.replace(/export\s+default\s+\w+\s*;?\s*/g, "") // export default を削除
4+
.replace(/export\s+/g, "") // 残りのexportを削除
5+
.replace(/export\s*\{[^}]*\}\s*from\s*['"][^'"]*['"]\s*;?\s*/g, "") // export {...} from を削除
56
.replace(/import\s+.*?from\s+['"].*?['"];?\s*/g, ""); // import文も削除
67
}
78

0 commit comments

Comments
 (0)