File tree Expand file tree Collapse file tree
packages/esbuild-plugin/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -287,23 +287,26 @@ export function sentryEsbuildPlugin(userOptions: Options = {}): any {
287287 } ;
288288 }
289289 ) ;
290+ }
291+
292+ // Create release and optionally upload
293+ const freeGlobalDependencyOnBuildArtifacts = createDependencyOnBuildArtifacts ( ) ;
294+ const upload = createDebugIdUploadFunction ( { sentryBuildPluginManager } ) ;
290295
291- // Upload
292- const freeGlobalDependencyOnBuildArtifacts = createDependencyOnBuildArtifacts ( ) ;
293- const upload = createDebugIdUploadFunction ( { sentryBuildPluginManager } ) ;
296+ initialOptions . metafile = true ;
297+ onEnd ( async ( result ) => {
298+ try {
299+ await sentryBuildPluginManager . createRelease ( ) ;
294300
295- initialOptions . metafile = true ;
296- onEnd ( async ( result ) => {
297- try {
298- await sentryBuildPluginManager . createRelease ( ) ;
301+ if ( sourcemapsEnabled && options . sourcemaps ?. disable !== "disable-upload" ) {
299302 const buildArtifacts = result . metafile ? Object . keys ( result . metafile . outputs ) : [ ] ;
300303 await upload ( buildArtifacts ) ;
301- } finally {
302- freeGlobalDependencyOnBuildArtifacts ( ) ;
303- await sentryBuildPluginManager . deleteArtifacts ( ) ;
304304 }
305- } ) ;
306- }
305+ } finally {
306+ freeGlobalDependencyOnBuildArtifacts ( ) ;
307+ await sentryBuildPluginManager . deleteArtifacts ( ) ;
308+ }
309+ } ) ;
307310 } ,
308311 } ;
309312}
You can’t perform that action at this time.
0 commit comments