Skip to content

Commit af7d637

Browse files
Lms24imatwawana
andauthored
Apply suggestions from code review
Co-authored-by: Isabel <[email protected]>
1 parent c407c11 commit af7d637

File tree

1 file changed

+10
-6
lines changed
  • src/platforms/javascript/common/configuration/tree-shaking

1 file changed

+10
-6
lines changed

src/platforms/javascript/common/configuration/tree-shaking/index.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ If you want to minimize the bundle size of the Sentry SDK, we recommend reading
1111

1212
## Tree Shaking Debug Code
1313

14-
Sentry ships with code that enables you to debug your Sentry configuration, primarily through logging. 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 includes a special flag in its CommonJS and ESM distributions which can be used to facilitate tree shaking (removal) of such code during the build process.
14+
Sentry ships with code that enables you to debug your Sentry configuration, primarily through logging. 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 includes a special flag in its CommonJS and ESM distributions which can be used to facilitate tree shaking (removal) of such code during the build process.
1515

1616
To make debugging code eligible for tree shaking, you must replace the `__SENTRY_DEBUG__` flag in the Sentry SDK with `false`.
1717

1818
<PlatformSection notSupported={["javascript.nextjs"]}>
1919

2020
### Tree Shaking Debug Code With Webpack
2121

22-
To tree shake Sentry debug code in your webpack bundles, we recommend using webpack's [DefinePlugin](https://webpack.js.org/plugins/define-plugin/).
22+
To tree shake Sentry debug code in your webpack bundles, we recommend using webpack's [DefinePlugin](https://webpack.js.org/plugins/define-plugin/):
2323

2424
```javascript {filename:webpack.config.js}
2525
const webpack = require("webpack");
@@ -41,7 +41,7 @@ module.exports = {
4141

4242
### Tree Shaking Debug Code With Rollup
4343

44-
If you're using `rollup.js`, we recommend using [Rollup's `replace` plugin](https://github.com/rollup/plugins/tree/master/packages/replace).
44+
If you're using `rollup.js`, we recommend using [Rollup's `replace` plugin](https://github.com/rollup/plugins/tree/master/packages/replace):
4545

4646
```javascript {filename:rollup.config.js}
4747
import replace from "@rollup/plugin-replace";
@@ -89,9 +89,9 @@ For more information on custom webpack configurations in Next.js, see [Custom We
8989
## Tree Shaking Default Integrations
9090

9191
By default, the Sentry SDK sets up a list of [default integrations](../integrations/default) that extend your
92-
SDK functionality. Furthermore, you can also add [additional](../integrations/plugin) or [custom](../integrations/custom)
92+
SDK functionality. You can also add [additional](../integrations/plugin) or [custom](../integrations/custom)
9393
integrations to your SDK configuration.
94-
In case you do not want to include default integrations in your config, you can [disable](../options/#integration-configuration)
94+
If you don't want to include default integrations in your config, you can [disable](../options/#integration-configuration)
9595
them and add your custom array of integrations.
9696
However, if you also want to tree shake the unused default integrations, you can do so by creating a `Client` yourself.
9797
By doing this, you essentially bypass `Sentry.init` which normally creates a `Client` for you.
@@ -126,5 +126,9 @@ const client = new BrowserClient({
126126
getCurrentHub().bindClient(client);
127127
```
128128

129-
Note that in contrast to `Sentry.init`, the `Client` constructor expects options of type `ClientOptions` instead of `Options`.
129+
<Note>
130+
131+
In contrast to `Sentry.init`, the `Client` constructor expects options of type `ClientOptions` instead of `Options`.
130132
This means that the `ClientOptions.integrations` property is the final array of integrations that will be used.
133+
134+
</Note>

0 commit comments

Comments
 (0)