File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { promisify } from "util";
66import { SentryBuildPluginManager } from "./build-plugin-manager" ;
77import { Logger } from "./logger" ;
88import { ResolveSourceMapHook , RewriteSourcesHook } from "./types" ;
9+ import { stripQueryAndHashFromPath } from "./utils" ;
910
1011interface DebugIdUploadPluginOptions {
1112 sentryBuildPluginManager : SentryBuildPluginManager ;
@@ -15,7 +16,10 @@ export function createDebugIdUploadFunction({
1516 sentryBuildPluginManager,
1617} : DebugIdUploadPluginOptions ) {
1718 return async ( buildArtifactPaths : string [ ] ) => {
18- await sentryBuildPluginManager . uploadSourcemaps ( buildArtifactPaths ) ;
19+ // Webpack and perhaps other bundlers allow you to append query strings to
20+ // filenames for cache busting purposes. We should strip these before upload.
21+ const cleanedPaths = buildArtifactPaths . map ( stripQueryAndHashFromPath ) ;
22+ await sentryBuildPluginManager . uploadSourcemaps ( cleanedPaths ) ;
1923 } ;
2024}
2125
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ export function createCjsBundles(
7777 output : {
7878 path : path . join ( outFolder , "webpack4" ) ,
7979 libraryTarget : "commonjs" ,
80+ filename : "[name].js?[contenthash]" ,
8081 } ,
8182 target : "node" , // needed for webpack 4 so we can access node api
8283 plugins : [ sentryWebpackPlugin ( sentryUnpluginOptions ) ] ,
You can’t perform that action at this time.
0 commit comments