Skip to content

Commit beae416

Browse files
committed
fix(misc): regex
1 parent fa23f94 commit beae416

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/core/supabase-js/tsdown.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ const injectBundlerIgnoreComments = (): Plugin => ({
1818
generateBundle(_options, bundle) {
1919
for (const [fileName, chunk] of Object.entries(bundle)) {
2020
if (chunk.type !== 'chunk' || !fileName.endsWith('.mjs')) continue
21+
// Source-side `import()` calls in @supabase/tracing are bare
22+
// `import(OTEL_PKG)` (no inline comments — rolldown strips them).
23+
// Match the identifier directly with a bounded character class —
24+
// no nested quantifiers, no backtracking surface.
2125
chunk.code = chunk.code.replace(
22-
/import\(\s*(?:\/\*[\s\S]*?\*\/\s*)*?(\w+)\s*\)/g,
26+
/import\(\s*([A-Za-z_$][\w$]*)\s*\)/g,
2327
'import(/* webpackIgnore: true */ /* turbopackIgnore: true */ /* @vite-ignore */ $1)'
2428
)
2529
}

0 commit comments

Comments
 (0)