Skip to content

Commit 64fe2c1

Browse files
smbroadleyLuca Forstner
andauthored
feat: Sort globbed files to ensure deterministic bundle IDs (#318)
Co-authored-by: Luca Forstner <luca.forstner@sentry.io>
1 parent 2c8e290 commit 64fe2c1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/bundler-plugin-core/src/debug-id-upload.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ export function createDebugIdUploadFunction({
8989
debugIdChunkFilePath.endsWith(".cjs")
9090
);
9191

92+
// The order of the files output by glob() is not deterministic
93+
// Ensure order within the files so that {debug-id}-{chunkIndex} coupling is consistent
94+
debugIdChunkFilePaths.sort();
95+
9296
if (Array.isArray(assets) && assets.length === 0) {
9397
logger.debug(
9498
"Empty `sourcemaps.assets` option provided. Will not upload sourcemaps with debug ID."

0 commit comments

Comments
 (0)