You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/platforms/javascript/common/troubleshooting/index.mdx
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -406,13 +406,13 @@ Remember to pass in `true` as the second parameter to `addEventListener()`. With
406
406
407
407
## Reducing Bundle Size
408
408
409
-
Sentry ships with code that enables you to <PlatformLinkto="/configuration/options/#debug">debug your Sentry configuration</PlatformLink>. While this code can be very useful in development environments, it is usually not necessary to include it in your production bundles where it takes up precious bytes. The JavaScript SDK uses special flags in its CommonJS and ESM distributions to facilitate tree-shaking of code sections that are used for debugging. Tree shaking is a way to remove unused code in your application during the build process.
409
+
Sentry ships with code that enables you to <PlatformLinkto="/configuration/options/#debug">debug your Sentry configuration</PlatformLink>. While this code can be very useful in development environments, it's not typically necessary to include it in your production bundles where it takes up valuable space. The JavaScript SDK uses special flags in its CommonJS and ESM distributions to facilitate treeshaking of code sections that are used for debugging. Tree shaking is a way to remove unused code in your application during the build process.
410
410
411
-
To mark any debug code as unused, we must replace debug flags in the sentry SDK with `false`. We outlined examples of how to do this in popular toolchains below.
411
+
To mark any debug code as unused, you must replace debug flags in the Sentry SDK with `false`. We've outlined examples of how to do this in popular toolchains below.
412
412
413
-
### Tree-shaking Debug Code with webpack
413
+
### Tree Shaking Debug Code With webpack
414
414
415
-
To tree-shake Sentry debug code in your webpack bundles, we recommend using webpack's [DefinePlugin](https://webpack.js.org/plugins/define-plugin/). Use it to replace all occurrences of the `__SENTRY_DEBUG__` flag with `false`:
415
+
To treeshake Sentry debug code in your webpack bundles, we recommend using webpack's [DefinePlugin](https://webpack.js.org/plugins/define-plugin/). Use it to replace all occurrences of the `__SENTRY_DEBUG__` flag with `false`:
416
416
417
417
```javascript {filename:webpack.config.js}
418
418
constwebpack=require("webpack");
@@ -428,9 +428,9 @@ module.exports = {
428
428
};
429
429
```
430
430
431
-
### Tree-shaking Debug Code with rollup.js
431
+
### Tree Shaking Debug Code With rollup.js
432
432
433
-
If you are using rollup.js, we recommend [rollup's replace plugin](https://www.npmjs.com/package/@rollup/plugin-replace) to replace all occurrences of `__SENTRY_DEBUG__` with `false`:
433
+
If you're using rollup.js, we recommend [rollup's replace plugin](https://www.npmjs.com/package/@rollup/plugin-replace) to replace all occurrences of `__SENTRY_DEBUG__` with `false`:
To tree-shake Sentry debug code in Next.js projects, you can use webpack's [DefinePlugin](https://webpack.js.org/plugins/define-plugin/). The following Next.js configuration will replace all occurrences of `__SENTRY_DEBUG__` in your bundles with `false`:
458
+
To treeshake Sentry debug code in Next.js projects, you can use webpack's [DefinePlugin](https://webpack.js.org/plugins/define-plugin/). The following Next.js configuration will replace all occurrences of `__SENTRY_DEBUG__` in your bundles with `false`:
459
459
460
460
```javascript {filename:next.config.js}
461
461
constnextConfig= {
@@ -472,6 +472,6 @@ const nextConfig = {
472
472
};
473
473
```
474
474
475
-
For more information on custom webpack configurations in Next.js see [Custom Webpack Config](https://nextjs.org/docs/api-reference/next.config.js/custom-webpack-config) in the Next.js docs.
475
+
For more information on custom webpack configurations in Next.js, see [Custom Webpack Config](https://nextjs.org/docs/api-reference/next.config.js/custom-webpack-config) in the Next.js docs.
0 commit comments