@@ -64,40 +64,40 @@ export default {
6464 } ,
6565 // RestPlugin activated only when Compiler=Rest env var is set.
6666 ...( RestPlugin ? [ RestPlugin ] : [ ] ) ,
67- // PostHog build telemetry — fire-and-forget on build end
68- {
69- name : "PostHogBuildTelemetry" ,
70- setup ( { onEnd } ) {
71- const StartTime = performance . now ( ) ;
72- onEnd ( async ( Result ) => {
73- const DurationMs = Math . round ( performance . now ( ) - StartTime ) ;
74- try {
75- const { request } = await import ( "node:https" ) ;
76- const Body = JSON . stringify ( {
77- api_key : "phc_mCwHy7LgvbnEqh6a2DyMiLUJcaZvmmj7JNmmpQzvr7mA" ,
78- event : "output:build:complete" ,
79- properties : {
80- distinct_id : `land-dev-${ process . env [ "USER" ] || "unknown" } ` ,
81- $app : "land-editor" ,
82- $component : "output" ,
83- $build_mode : On ? "development" : "production" ,
84- duration_ms : DurationMs ,
85- errors : Result . errors . length ,
86- warnings : Result . warnings . length ,
87- compiler : process . env [ "Compiler" ] || "esbuild" ,
88- } ,
89- timestamp : new Date ( ) . toISOString ( ) ,
90- } ) ;
91- const Url = new URL ( "https://eu.i.posthog.com/capture/" ) ;
92- const Req = request ( { hostname : Url . hostname , port : 443 , path : Url . pathname , method : "POST" , headers : { "Content-Type" : "application/json" , "Content-Length" : Buffer . byteLength ( Body ) } } ) ;
93- Req . on ( "error" , ( ) => { } ) ;
94- Req . write ( Body ) ;
95- Req . end ( ) ;
96- }
97- catch { }
98- } ) ;
99- } ,
100- } ,
67+ // PostHog build telemetry — debug only, skipped in production
68+ ... ( process . env [ "NODE_ENV" ] !== "production" ? [ {
69+ name : "PostHogBuildTelemetry" ,
70+ setup ( { onEnd } ) {
71+ const StartTime = performance . now ( ) ;
72+ onEnd ( async ( Result ) => {
73+ const DurationMs = Math . round ( performance . now ( ) - StartTime ) ;
74+ try {
75+ const { request } = await import ( "node:https" ) ;
76+ const Body = JSON . stringify ( {
77+ api_key : "phc_mCwHy7LgvbnEqh6a2DyMiLUJcaZvmmj7JNmmpQzvr7mA" ,
78+ event : "output:build:complete" ,
79+ properties : {
80+ distinct_id : `land-dev-${ process . env [ "USER" ] || "unknown" } ` ,
81+ $app : "land-editor" ,
82+ $component : "output" ,
83+ $build_mode : On ? "development" : "production" ,
84+ duration_ms : DurationMs ,
85+ errors : Result . errors . length ,
86+ warnings : Result . warnings . length ,
87+ compiler : process . env [ "Compiler" ] || "esbuild" ,
88+ } ,
89+ timestamp : new Date ( ) . toISOString ( ) ,
90+ } ) ;
91+ const Url = new URL ( "https://eu.i.posthog.com/capture/" ) ;
92+ const Req = request ( { hostname : Url . hostname , port : 443 , path : Url . pathname , method : "POST" , headers : { "Content-Type" : "application/json" , "Content-Length" : Buffer . byteLength ( Body ) } } ) ;
93+ Req . on ( "error" , ( ) => { } ) ;
94+ Req . write ( Body ) ;
95+ Req . end ( ) ;
96+ }
97+ catch { }
98+ } ) ;
99+ } ,
100+ } ] : [ ] ) ,
101101 ] . filter ( Boolean ) ,
102102 loader : {
103103 ".json" : "copy" ,
0 commit comments