Skip to content

Commit

Permalink
Fix HMR url for vite (#37)
Browse files Browse the repository at this point in the history
Co-authored-by: jdickson <joel.dickson@agoda.com>
  • Loading branch information
joeldickson and dicko2 authored Feb 13, 2025
1 parent a3cdfdd commit 1743e9a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/common/src/lib/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const getEndpointFromType = (type: string) => {
return {
webpack: process.env.WEBPACK_ENDPOINT || 'http://compilation-metrics/webpack',
vite: process.env.VITE_ENDPOINT || 'http://compilation-metrics/vite',
vitehmr: process.env.VITE_ENDPOINT || 'http://compilation-metrics/vite',
rsbuild: process.env.WEBPACK_ENDPOINT || 'http://compilation-metrics/webpack',
}[type];
};
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface ViteBundleStats {
}

export interface ViteBuildData extends CommonMetadata {
type: string;
type: 'vite' | 'vitehmr';
viteVersion: string | null;
bundleStats?: ViteBundleStats;
file: string | null;
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin/src/lib/vite-build-stats-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function viteBuildStatsPlugin(

const metricsData: ViteBuildData = {
...getCommonMetadata(totalTime, customIdentifier),
type: 'vite-hmr',
type: 'vitehmr',
viteVersion: rollupVersion ?? null,
bundleStats: {
bootstrapChunkSizeBytes: undefined,
Expand Down

0 comments on commit 1743e9a

Please sign in to comment.