Skip to content

Commit

Permalink
fix size limit
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Feb 28, 2024
1 parent ee1ec19 commit 921c283
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
34 changes: 20 additions & 14 deletions .size-limit.js
Expand Up @@ -2,28 +2,28 @@ module.exports = [
// Main browser webpack builds
{
name: '@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
path: 'packages/browser/build/npm/esm/index.mjs',
import: '{ init, Replay, browserTracingIntegration, Feedback }',
gzip: true,
limit: '90 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
path: 'packages/browser/build/npm/esm/index.mjs',
import: '{ init, Replay, browserTracingIntegration }',
gzip: true,
limit: '75 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
path: 'packages/browser/build/npm/esm/index.mjs',
import: '{ init, Replay, browserTracingIntegration, ReplayCanvas }',
gzip: true,
limit: '90 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
path: 'packages/browser/build/npm/esm/index.mjs',
import: '{ init, Replay, browserTracingIntegration }',
gzip: true,
limit: '75 KB',
Expand All @@ -42,35 +42,35 @@ module.exports = [
},
{
name: '@sentry/browser (incl. Tracing) - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
path: 'packages/browser/build/npm/esm/index.mjs',
import: '{ init, browserTracingIntegration }',
gzip: true,
limit: '35 KB',
},
{
name: '@sentry/browser (incl. browserTracingIntegration) - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
path: 'packages/browser/build/npm/esm/index.mjs',
import: '{ init, browserTracingIntegration }',
gzip: true,
limit: '35 KB',
},
{
name: '@sentry/browser (incl. Feedback) - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
path: 'packages/browser/build/npm/esm/index.mjs',
import: '{ init, Feedback }',
gzip: true,
limit: '50 KB',
},
{
name: '@sentry/browser (incl. sendFeedback) - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
path: 'packages/browser/build/npm/esm/index.mjs',
import: '{ init, sendFeedback }',
gzip: true,
limit: '50 KB',
},
{
name: '@sentry/browser - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
path: 'packages/browser/build/npm/esm/index.mjs',
import: '{ init }',
gzip: true,
limit: '28 KB',
Expand Down Expand Up @@ -137,37 +137,43 @@ module.exports = [
// React
{
name: '@sentry/react (incl. Tracing, Replay) - Webpack (gzipped)',
path: 'packages/react/build/esm/index.js',
path: 'packages/react/build/esm/index.mjs',
import: '{ init, browserTracingIntegration, Replay }',
gzip: true,
limit: '75 KB',
},
{
name: '@sentry/react - Webpack (gzipped)',
path: 'packages/react/build/esm/index.js',
path: 'packages/react/build/esm/index.mjs',
import: '{ init }',
gzip: true,
limit: '30 KB',
},

// Next.js
// We ignore next/router and next/constants because they break size-limit calculation
// with new *.mjs bundles in v8
{
name: '@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped)',
path: 'packages/nextjs/build/esm/client/index.js',
path: 'packages/nextjs/build/esm/client/index.mjs',
import: '{ init, browserTracingIntegration, Replay }',
ignore: ['next/router', 'next/constants'],
gzip: true,
limit: '110 KB',
},
{
name: '@sentry/nextjs Client - Webpack (gzipped)',
path: 'packages/nextjs/build/esm/client/index.js',
path: 'packages/nextjs/build/esm/client/index.mjs',
import: '{ init }',
ignore: ['next/router', 'next/constants'],
gzip: true,
limit: '57 KB',
},

// Feedback
{
name: '@sentry-internal/feedback - Webpack (gzipped)',
path: 'packages/feedback/build/npm/esm/index.js',
path: 'packages/feedback/build/npm/esm/index.mjs',
import: '{ Feedback }',
gzip: true,
limit: '25 KB',
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/rollup-utils/npmHelpers.mjs
Expand Up @@ -118,7 +118,7 @@ export function makeBaseNPMConfig(options = {}) {
}

export function makeNPMConfigVariants(baseConfig, options = {}) {
const { emitMjs = true, entryFileNameWithoutExtension = '[name]'} = options;
const { emitMjs = true, entryFileNameWithoutExtension = '[name]' } = options;
const variantSpecificConfigs = [
{ output: { format: 'cjs', dir: path.join(baseConfig.output.dir, 'cjs') } },
{ output: { format: 'esm', dir: path.join(baseConfig.output.dir, 'esm') } },
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/rollup.npm.config.mjs
Expand Up @@ -53,7 +53,7 @@ export default [
},
}),
// Preserve the original file structure (i.e., so that everything is still relative to `src`)
{ entryFileNameWithoutExtension: 'config/templates/[name]' }
{ entryFileNameWithoutExtension: 'config/templates/[name]' },
),
...makeNPMConfigVariants(
makeBaseNPMConfig({
Expand All @@ -68,6 +68,6 @@ export default [
},
}),
// Preserve the original file structure (i.e., so that everything is still relative to `src`)
{ entryFileNameWithoutExtension: 'config/loaders/[name]' }
{ entryFileNameWithoutExtension: 'config/loaders/[name]' },
),
];

0 comments on commit 921c283

Please sign in to comment.