Skip to content

Commit 495d006

Browse files
committed
Use uuid
1 parent 0a5ea98 commit 495d006

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

.config/rollup.dist.config.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from 'node:fs'
99
import path from 'node:path'
1010
import { spawnSync } from 'node:child_process'
11+
import { randomUUID } from 'node:crypto'
1112

1213
import { globSync as tinyGlobSync } from 'tinyglobby'
1314

@@ -139,9 +140,7 @@ function versionBanner(_chunk) {
139140
// Make each build generate a unique version id, regardless
140141
// Mostly for development: confirms the build refreshed. For prod
141142
// builds the git hash should suffice to identify the build.
142-
// Note: It's okay that Math.random() is not "secure".
143-
// Drop the `0.`, force to 16 digits.
144-
const rng = String(Math.random()).slice(2).padStart(16, '0');
143+
const rng = randomUUID().split('-')[0];
145144

146145
return `
147146
var SOCKET_CLI_PKG_JSON_VERSION = "${pkgJsonVersion}"

0 commit comments

Comments
 (0)