Skip to content

ci: Update size-limit to ensure bundle size optimization #13571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@ module.exports = [
gzip: true,
limit: '24 KB',
},
{
name: '@sentry/browser - with treeshaking flags',
path: 'packages/browser/build/npm/esm/index.js',
import: createImport('init'),
gzip: true,
limit: '24 KB',
modifyWebpackConfig: function (config) {
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');

config.plugins.push(
new webpack.DefinePlugin({
__SENTRY_DEBUG__: false,
__RRWEB_EXCLUDE_SHADOW_DOM__: true,
__RRWEB_EXCLUDE_IFRAME__: true,
__SENTRY_EXCLUDE_REPLAY_WORKER__: true,
}),
);

config.optimization.minimize = true;
config.optimization.minimizer = [new TerserPlugin()];

return config;
},
},
{
name: '@sentry/browser (incl. Tracing)',
path: 'packages/browser/build/npm/esm/index.js',
Expand All @@ -32,6 +57,8 @@ module.exports = [
limit: '68 KB',
modifyWebpackConfig: function (config) {
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');

config.plugins.push(
new webpack.DefinePlugin({
__SENTRY_DEBUG__: false,
Expand All @@ -40,6 +67,10 @@ module.exports = [
__SENTRY_EXCLUDE_REPLAY_WORKER__: true,
}),
);

config.optimization.minimize = true;
config.optimization.minimizer = [new TerserPlugin()];

return config;
},
},
Expand Down Expand Up @@ -222,11 +253,17 @@ module.exports = [
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
modifyWebpackConfig: function (config) {
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');

config.plugins.push(
new webpack.DefinePlugin({
__SENTRY_TRACING__: false,
}),
);

config.optimization.minimize = true;
config.optimization.minimizer = [new TerserPlugin()];

return config;
},
},
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"babel-loader": "^8.2.2",
"html-webpack-plugin": "^5.5.0",
"pako": "^2.1.0",
"webpack": "^5.90.3"
"webpack": "^5.94.0"
},
"devDependencies": {
"@types/glob": "8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/bundle-analyzer-scenarios/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"private": true,
"dependencies": {
"html-webpack-plugin": "^5.6.0",
"webpack": "^5.92.1",
"webpack": "^5.94.0",
"webpack-bundle-analyzer": "^4.10.2"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ember/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"qunit": "~2.19.2",
"qunit-dom": "~2.0.0",
"sinon": "15.2.0",
"webpack": "~5.90.3"
"webpack": "~5.94.0"
},
"engines": {
"node": ">=14.18"
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
},
"peerDependencies": {
"next": "^13.2.0 || ^14.0 || ^15.0.0-rc.0",
"webpack": ">= 5.0.0"
"webpack": "5.94.0"
},
"peerDependenciesMeta": {
"webpack": {
Expand Down
Loading
Loading