@@ -85,28 +85,6 @@ export function sentryUnpluginFactory({
8585 } ,
8686 } ) ;
8787
88- // Add plugin to create and finalize releases, and also take care of adding commits and legacy sourcemaps
89- const freeGlobalDependencyOnBuildArtifacts =
90- sentryBuildPluginManager . createDependencyOnBuildArtifacts ( ) ;
91- plugins . push ( {
92- name : "sentry-release-management-plugin" ,
93- async writeBundle ( ) {
94- try {
95- await sentryBuildPluginManager . createRelease ( ) ;
96- } finally {
97- freeGlobalDependencyOnBuildArtifacts ( ) ;
98- }
99- } ,
100- } ) ;
101-
102- // Add plugin to delete unwanted artifacts like source maps after the uploads have completed
103- plugins . push ( {
104- name : "sentry-file-deletion-plugin" ,
105- async writeBundle ( ) {
106- await sentryBuildPluginManager . deleteArtifacts ( ) ;
107- } ,
108- } ) ;
109-
11088 if ( Object . keys ( bundleSizeOptimizationReplacementValues ) . length > 0 ) {
11189 plugins . push ( bundleSizeOptimizationsPlugin ( bundleSizeOptimizationReplacementValues ) ) ;
11290 }
@@ -134,6 +112,20 @@ export function sentryUnpluginFactory({
134112 plugins . push ( moduleMetadataInjectionPlugin ( injectionCode ) ) ;
135113 }
136114
115+ // Add plugin to create and finalize releases, and also take care of adding commits and legacy sourcemaps
116+ const freeGlobalDependencyOnBuildArtifacts =
117+ sentryBuildPluginManager . createDependencyOnBuildArtifacts ( ) ;
118+ plugins . push ( {
119+ name : "sentry-release-management-plugin" ,
120+ async writeBundle ( ) {
121+ try {
122+ await sentryBuildPluginManager . createRelease ( ) ;
123+ } finally {
124+ freeGlobalDependencyOnBuildArtifacts ( ) ;
125+ }
126+ } ,
127+ } ) ;
128+
137129 if ( ! options . sourcemaps ?. disable ) {
138130 plugins . push ( debugIdInjectionPlugin ( logger ) ) ;
139131 }
@@ -172,6 +164,14 @@ export function sentryUnpluginFactory({
172164 }
173165 }
174166
167+ // Add plugin to delete unwanted artifacts like source maps after the uploads have completed
168+ plugins . push ( {
169+ name : "sentry-file-deletion-plugin" ,
170+ async writeBundle ( ) {
171+ await sentryBuildPluginManager . deleteArtifacts ( ) ;
172+ } ,
173+ } ) ;
174+
175175 return plugins ;
176176 } ) ;
177177}
0 commit comments