Skip to content

Commit b2a0787

Browse files
committed
ci: Update size-limit to ensure bundle size optimization
1 parent 3180113 commit b2a0787

File tree

6 files changed

+56
-186
lines changed

6 files changed

+56
-186
lines changed

.size-limit.js

+37
Original file line numberDiff line numberDiff line change
@@ -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
},

dev-packages/browser-integration-tests/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"babel-loader": "^8.2.2",
4949
"html-webpack-plugin": "^5.5.0",
5050
"pako": "^2.1.0",
51-
"webpack": "^5.90.3"
51+
"webpack": "^5.94.0"
5252
},
5353
"devDependencies": {
5454
"@types/glob": "8.0.0",

dev-packages/bundle-analyzer-scenarios/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"private": true,
1010
"dependencies": {
1111
"html-webpack-plugin": "^5.6.0",
12-
"webpack": "^5.92.1",
12+
"webpack": "^5.94.0",
1313
"webpack-bundle-analyzer": "^4.10.2"
1414
},
1515
"scripts": {

packages/ember/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"qunit": "~2.19.2",
8181
"qunit-dom": "~2.0.0",
8282
"sinon": "15.2.0",
83-
"webpack": "~5.90.3"
83+
"webpack": "~5.94.0"
8484
},
8585
"engines": {
8686
"node": ">=14.18"

packages/nextjs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
},
9292
"peerDependencies": {
9393
"next": "^13.2.0 || ^14.0 || ^15.0.0-rc.0",
94-
"webpack": ">= 5.0.0"
94+
"webpack": "5.94.0"
9595
},
9696
"peerDependenciesMeta": {
9797
"webpack": {

0 commit comments

Comments
 (0)