From 590fecd2be3074b13e0d9cd4218c52b203619d1d Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Tue, 8 Aug 2023 14:04:41 +0200 Subject: [PATCH] ref: Make asset detection more robust (#369) --- packages/bundler-plugin-core/src/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/bundler-plugin-core/src/index.ts b/packages/bundler-plugin-core/src/index.ts index cba4db4f..18f3d607 100644 --- a/packages/bundler-plugin-core/src/index.ts +++ b/packages/bundler-plugin-core/src/index.ts @@ -20,6 +20,7 @@ import { stripQueryAndHashFromPath, } from "./utils"; import * as dotenv from "dotenv"; +import { glob } from "glob"; interface SentryUnpluginFactoryOptions { releaseInjectionPlugin: (injectionCode: string) => UnpluginOptions; @@ -420,7 +421,11 @@ export function createRollupDebugIdUploadHooks( ) { if (outputOptions.dir) { const outputDir = outputOptions.dir; - const buildArtifacts = Object.keys(bundle).map((asset) => path.join(outputDir, asset)); + const buildArtifacts = await glob(["/**/*.js", "/**/*.js.map"], { + root: outputDir, + absolute: true, + nodir: true, + }); await upload(buildArtifacts); } else if (outputOptions.file) { await upload([outputOptions.file]);