We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa23f94 commit beae416Copy full SHA for beae416
1 file changed
packages/core/supabase-js/tsdown.config.ts
@@ -18,8 +18,12 @@ const injectBundlerIgnoreComments = (): Plugin => ({
18
generateBundle(_options, bundle) {
19
for (const [fileName, chunk] of Object.entries(bundle)) {
20
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.
25
chunk.code = chunk.code.replace(
- /import\(\s*(?:\/\*[\s\S]*?\*\/\s*)*?(\w+)\s*\)/g,
26
+ /import\(\s*([A-Za-z_$][\w$]*)\s*\)/g,
27
'import(/* webpackIgnore: true */ /* turbopackIgnore: true */ /* @vite-ignore */ $1)'
28
)
29
}
0 commit comments