Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/bundler-plugin-core/src/debug-id-upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { promisify } from "util";
import { SentryBuildPluginManager } from "./build-plugin-manager";
import { Logger } from "./logger";
import { ResolveSourceMapHook, RewriteSourcesHook } from "./types";
import { stripQueryAndHashFromPath } from "./utils";

interface DebugIdUploadPluginOptions {
sentryBuildPluginManager: SentryBuildPluginManager;
Expand All @@ -15,7 +16,10 @@ export function createDebugIdUploadFunction({
sentryBuildPluginManager,
}: DebugIdUploadPluginOptions) {
return async (buildArtifactPaths: string[]) => {
await sentryBuildPluginManager.uploadSourcemaps(buildArtifactPaths);
// Webpack and perhaps other bundlers allow you to append query strings to
// filenames for cache busting purposes. We should strip these before upload.
const cleanedPaths = buildArtifactPaths.map(stripQueryAndHashFromPath);
await sentryBuildPluginManager.uploadSourcemaps(cleanedPaths);
};
}

Expand Down
1 change: 1 addition & 0 deletions packages/integration-tests/utils/create-cjs-bundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export function createCjsBundles(
output: {
path: path.join(outFolder, "webpack4"),
libraryTarget: "commonjs",
filename: "[name].js?[contenthash]",
},
target: "node", // needed for webpack 4 so we can access node api
plugins: [sentryWebpackPlugin(sentryUnpluginOptions)],
Expand Down
Loading