Skip to content

Commit 1743e9a

Browse files
joeldicksondicko2
andauthored
Fix HMR url for vite (#37)
Co-authored-by: jdickson <joel.dickson@agoda.com>
1 parent a3cdfdd commit 1743e9a

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

packages/common/src/lib/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const getEndpointFromType = (type: string) => {
6565
return {
6666
webpack: process.env.WEBPACK_ENDPOINT || 'http://compilation-metrics/webpack',
6767
vite: process.env.VITE_ENDPOINT || 'http://compilation-metrics/vite',
68+
vitehmr: process.env.VITE_ENDPOINT || 'http://compilation-metrics/vite',
6869
rsbuild: process.env.WEBPACK_ENDPOINT || 'http://compilation-metrics/webpack',
6970
}[type];
7071
};

packages/common/src/lib/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export interface ViteBundleStats {
4949
}
5050

5151
export interface ViteBuildData extends CommonMetadata {
52-
type: string;
52+
type: 'vite' | 'vitehmr';
5353
viteVersion: string | null;
5454
bundleStats?: ViteBundleStats;
5555
file: string | null;

packages/vite-plugin/src/lib/vite-build-stats-plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function viteBuildStatsPlugin(
9696

9797
const metricsData: ViteBuildData = {
9898
...getCommonMetadata(totalTime, customIdentifier),
99-
type: 'vite-hmr',
99+
type: 'vitehmr',
100100
viteVersion: rollupVersion ?? null,
101101
bundleStats: {
102102
bootstrapChunkSizeBytes: undefined,

0 commit comments

Comments
 (0)