@@ -10,6 +10,31 @@ module.exports = [
1010 gzip : true ,
1111 limit : '24 KB' ,
1212 } ,
13+ {
14+ name : '@sentry/browser - with treeshaking flags' ,
15+ path : 'packages/browser/build/npm/esm/index.js' ,
16+ import : createImport ( 'init' ) ,
17+ gzip : true ,
18+ limit : '24 KB' ,
19+ modifyWebpackConfig : function ( config ) {
20+ const webpack = require ( 'webpack' ) ;
21+ const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
22+
23+ config . plugins . push (
24+ new webpack . DefinePlugin ( {
25+ __SENTRY_DEBUG__ : false ,
26+ __RRWEB_EXCLUDE_SHADOW_DOM__ : true ,
27+ __RRWEB_EXCLUDE_IFRAME__ : true ,
28+ __SENTRY_EXCLUDE_REPLAY_WORKER__ : true ,
29+ } ) ,
30+ ) ;
31+
32+ config . optimization . minimize = true ;
33+ config . optimization . minimizer = [ new TerserPlugin ( ) ] ;
34+
35+ return config ;
36+ } ,
37+ } ,
1338 {
1439 name : '@sentry/browser (incl. Tracing)' ,
1540 path : 'packages/browser/build/npm/esm/index.js' ,
@@ -32,6 +57,8 @@ module.exports = [
3257 limit : '68 KB' ,
3358 modifyWebpackConfig : function ( config ) {
3459 const webpack = require ( 'webpack' ) ;
60+ const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
61+
3562 config . plugins . push (
3663 new webpack . DefinePlugin ( {
3764 __SENTRY_DEBUG__ : false ,
@@ -40,6 +67,10 @@ module.exports = [
4067 __SENTRY_EXCLUDE_REPLAY_WORKER__ : true ,
4168 } ) ,
4269 ) ;
70+
71+ config . optimization . minimize = true ;
72+ config . optimization . minimizer = [ new TerserPlugin ( ) ] ;
73+
4374 return config ;
4475 } ,
4576 } ,
@@ -222,11 +253,17 @@ module.exports = [
222253 ignore : [ ...builtinModules , ...nodePrefixedBuiltinModules ] ,
223254 modifyWebpackConfig : function ( config ) {
224255 const webpack = require ( 'webpack' ) ;
256+ const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
257+
225258 config . plugins . push (
226259 new webpack . DefinePlugin ( {
227260 __SENTRY_TRACING__ : false ,
228261 } ) ,
229262 ) ;
263+
264+ config . optimization . minimize = true ;
265+ config . optimization . minimizer = [ new TerserPlugin ( ) ] ;
266+
230267 return config ;
231268 } ,
232269 } ,
0 commit comments