@leftium/gg 0.0.36 → 0.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -38,6 +38,10 @@ export default function ggCallSitesPlugin(options = {}) {
|
|
|
38
38
|
// Only process JS/TS/Svelte files
|
|
39
39
|
if (!/\.(js|ts|svelte|jsx|tsx|mjs|mts)(\?.*)?$/.test(id))
|
|
40
40
|
return null;
|
|
41
|
+
// Don't transform code inside node_modules
|
|
42
|
+
// This prevents rewriting library code (including gg itself when published)
|
|
43
|
+
if (id.includes('/node_modules/'))
|
|
44
|
+
return null;
|
|
41
45
|
// Quick bail: no gg calls in this file
|
|
42
46
|
if (!code.includes('gg(') &&
|
|
43
47
|
!code.includes('gg.ns(') &&
|
|
@@ -51,9 +55,6 @@ export default function ggCallSitesPlugin(options = {}) {
|
|
|
51
55
|
!code.includes('gg.timeLog(') &&
|
|
52
56
|
!code.includes('gg.timeEnd('))
|
|
53
57
|
return null;
|
|
54
|
-
// Don't transform gg's own source files
|
|
55
|
-
if (id.includes('/lib/gg.') || id.includes('/lib/debug'))
|
|
56
|
-
return null;
|
|
57
58
|
// Build the short callpoint from the file path (strips src/ prefix)
|
|
58
59
|
// e.g. "/Users/me/project/src/routes/+page.svelte" → "routes/+page.svelte"
|
|
59
60
|
const shortPath = id.replace(srcRootRegex, '');
|