@@ -10,6 +10,31 @@ module.exports = [
10
10
gzip : true ,
11
11
limit : '24 KB' ,
12
12
} ,
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
+ } ,
13
38
{
14
39
name : '@sentry/browser (incl. Tracing)' ,
15
40
path : 'packages/browser/build/npm/esm/index.js' ,
@@ -32,6 +57,8 @@ module.exports = [
32
57
limit : '68 KB' ,
33
58
modifyWebpackConfig : function ( config ) {
34
59
const webpack = require ( 'webpack' ) ;
60
+ const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
61
+
35
62
config . plugins . push (
36
63
new webpack . DefinePlugin ( {
37
64
__SENTRY_DEBUG__ : false ,
@@ -40,6 +67,10 @@ module.exports = [
40
67
__SENTRY_EXCLUDE_REPLAY_WORKER__ : true ,
41
68
} ) ,
42
69
) ;
70
+
71
+ config . optimization . minimize = true ;
72
+ config . optimization . minimizer = [ new TerserPlugin ( ) ] ;
73
+
43
74
return config ;
44
75
} ,
45
76
} ,
@@ -222,11 +253,17 @@ module.exports = [
222
253
ignore : [ ...builtinModules , ...nodePrefixedBuiltinModules ] ,
223
254
modifyWebpackConfig : function ( config ) {
224
255
const webpack = require ( 'webpack' ) ;
256
+ const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
257
+
225
258
config . plugins . push (
226
259
new webpack . DefinePlugin ( {
227
260
__SENTRY_TRACING__ : false ,
228
261
} ) ,
229
262
) ;
263
+
264
+ config . optimization . minimize = true ;
265
+ config . optimization . minimizer = [ new TerserPlugin ( ) ] ;
266
+
230
267
return config ;
231
268
} ,
232
269
} ,
0 commit comments