Skip to content

Commit afca710

Browse files
committed
fix: use random UUID as fallback for build_id in bundler-plugin
1 parent 1f65255 commit afca710

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/lemon-moles-type.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@faststats/sourcemap-uploader-plugin": patch
3+
---
4+
5+
fix: use random uuid as fallback build_id

packages/bundler-plugin/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,10 @@ const unpluginInstance = createUnplugin<BundlerPluginOptions>(
462462
};
463463
}
464464

465-
const buildId = options.buildId ?? getGitCommitHashSync() ?? "unknown";
465+
const buildId =
466+
options.buildId ??
467+
getGitCommitHashSync() ??
468+
`random_${crypto.randomUUID()}`;
466469
const globalKey = options.globalKey ?? "__SOURCEMAPS_BUILD__";
467470
const injection = createGlobalInjection(globalKey, buildId);
468471

0 commit comments

Comments
 (0)