File tree 3 files changed +8
-5
lines changed
3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ const getEndpointFromType = (type: string) => {
65
65
return {
66
66
webpack : process . env . WEBPACK_ENDPOINT || 'http://compilation-metrics/webpack' ,
67
67
vite : process . env . VITE_ENDPOINT || 'http://compilation-metrics/vite' ,
68
+ vitehmr : process . env . VITE_ENDPOINT || 'http://compilation-metrics/vite' ,
68
69
rsbuild : process . env . WEBPACK_ENDPOINT || 'http://compilation-metrics/webpack' ,
69
70
} [ type ] ;
70
71
} ;
@@ -102,5 +103,7 @@ export const sendBuildData = async (
102
103
return ;
103
104
}
104
105
105
- console . log ( `Your build stats has successfully been sent.` ) ;
106
+ console . log (
107
+ `Your build stats has successfully been sent to ${ endpoint } for ${ buildStats . type } .` ,
108
+ ) ;
106
109
} ;
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export interface ViteBundleStats {
49
49
}
50
50
51
51
export interface ViteBuildData extends CommonMetadata {
52
- type : 'vite' ;
52
+ type : 'vite' | 'vitehmr' ;
53
53
viteVersion : string | null ;
54
54
bundleStats ?: ViteBundleStats ;
55
55
file : string | null ;
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ export function viteBuildStatsPlugin(
96
96
97
97
const metricsData : ViteBuildData = {
98
98
...getCommonMetadata ( totalTime , customIdentifier ) ,
99
- type : 'vite ' ,
99
+ type : 'vitehmr ' ,
100
100
viteVersion : rollupVersion ?? null ,
101
101
bundleStats : {
102
102
bootstrapChunkSizeBytes : undefined ,
@@ -111,7 +111,7 @@ export function viteBuildStatsPlugin(
111
111
res . writeHead ( 200 , { 'Content-Type' : 'application/json' } ) ;
112
112
res . end ( JSON . stringify ( { success : true } ) ) ;
113
113
} else {
114
- res . writeHead ( 200 , { 'Content-Type' : 'application/json' } ) ;
114
+ res . writeHead ( 404 , { 'Content-Type' : 'application/json' } ) ;
115
115
res . end (
116
116
JSON . stringify ( {
117
117
success : false ,
@@ -123,7 +123,7 @@ export function viteBuildStatsPlugin(
123
123
}
124
124
} catch ( err ) {
125
125
console . error ( '[vite-timing] Error processing timing data:' , err ) ;
126
- res . writeHead ( 200 , { 'Content-Type' : 'application/json' } ) ;
126
+ res . writeHead ( 500 , { 'Content-Type' : 'application/json' } ) ;
127
127
res . end (
128
128
JSON . stringify ( {
129
129
success : false ,
You can’t perform that action at this time.
0 commit comments