Skip to content

Commit 13ef01a

Browse files
lforstimatwawana
andauthored
Apply suggestions from code review
Co-authored-by: Isabel <[email protected]>
1 parent 5a55c67 commit 13ef01a

File tree

1 file changed

+9
-9
lines changed
  • src/platforms/javascript/common/troubleshooting

1 file changed

+9
-9
lines changed

src/platforms/javascript/common/troubleshooting/index.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,13 @@ Remember to pass in `true` as the second parameter to `addEventListener()`. With
406406

407407
## Reducing Bundle Size
408408

409-
Sentry ships with code that enables you to <PlatformLink to="/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 <PlatformLink to="/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 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.
410410

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.
412412

413-
### Tree-shaking Debug Code with webpack
413+
### Tree Shaking Debug Code With webpack
414414

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 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`:
416416

417417
```javascript {filename:webpack.config.js}
418418
const webpack = require("webpack");
@@ -428,9 +428,9 @@ module.exports = {
428428
};
429429
```
430430

431-
### Tree-shaking Debug Code with rollup.js
431+
### Tree Shaking Debug Code With rollup.js
432432

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`:
434434

435435
```javascript {filename:rollup.config.js}
436436
import replace from "@rollup/plugin-replace";
@@ -453,9 +453,9 @@ export default {
453453

454454
<PlatformSection supported={["javascript.nextjs"]}>
455455

456-
### Tree-shaking Debug Code with Next.js
456+
### Tree Shaking Debug Code With Next.js
457457

458-
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 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`:
459459

460460
```javascript {filename:next.config.js}
461461
const nextConfig = {
@@ -472,6 +472,6 @@ const nextConfig = {
472472
};
473473
```
474474

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.
476476

477477
</PlatformSection>

0 commit comments

Comments
 (0)