From b240a8347e7b62bee9d2212625732bb0d8c78633 Mon Sep 17 00:00:00 2001 From: houfeng Date: Tue, 23 Jul 2024 23:09:52 +0800 Subject: [PATCH] fix(build): env output is not stable (#17748) --- packages/vite/src/node/plugins/define.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/plugins/define.ts b/packages/vite/src/node/plugins/define.ts index 786a1038505c00..da50836294a0af 100644 --- a/packages/vite/src/node/plugins/define.ts +++ b/packages/vite/src/node/plugins/define.ts @@ -195,7 +195,7 @@ export async function replaceDefine( */ export function serializeDefine(define: Record): string { let res = `{` - const keys = Object.keys(define) + const keys = Object.keys(define).sort() for (let i = 0; i < keys.length; i++) { const key = keys[i] const val = define[key]