Skip to content
Draft
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
2 changes: 1 addition & 1 deletion docs/integrations/deployment/vercel/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Use Vercel to [link projects](#project-linking) for uploading source maps and no

- If you have not already done so, [instrument your code with Sentry](/platforms/javascript/).
- Ensure you have [installed a repository integration](/product/releases/setup/release-automation/) and added the relevant repository.
- Add a Sentry bundler plugin to your bundler configuration ([webpack plugin](https://www.npmjs.com/package/@sentry/webpack-plugin), [Vite Plugin](https://www.npmjs.com/package/@sentry/vite-plugin), [Esbuild Plugin](https://www.npmjs.com/package/@sentry/esbuild-plugin), [Rollup Plugin](https://www.npmjs.com/package/@sentry/rollup-plugin)). If you are using Sentry's Next.js, or SvelteKit SDKs this will already have been done for you.
- Add a Sentry bundler plugin to your bundler configuration ([webpack plugin](/platforms/javascript/sourcemaps/uploading/webpack/), [Vite Plugin](/platforms/javascript/sourcemaps/uploading/vite/), [Esbuild Plugin](/platforms/javascript/sourcemaps/uploading/esbuild/), [Rollup Plugin](/platforms/javascript/sourcemaps/uploading/rollup/)). If you are using Sentry's Next.js, or SvelteKit SDKs this will already have been done for you.
- In case you already have a Vercel project integrated with Sentry, ensure the Sentry project you link is the one you're already using to report errors.

### Drains
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ fix them faster in complex frontend architectures.
<Alert>
<ul>
<li>
Requires version `2.18.0` or higher of `@sentry/webpack-plugin`,
`@sentry/rollup-plugin`, `@sentry/vite-plugin` or
`@sentry/esbuild-plugin`.
Requires `@sentry/bundler-plugins/webpack`,
`@sentry/bundler-plugins/rollup`, `@sentry/bundler-plugins/vite` or
`@sentry/bundler-plugins/esbuild`.
</li>
<li>Requires SDK version `7.59.0` or higher.</li>
</ul>
Expand All @@ -80,7 +80,7 @@ below is for Webpack, but this is also supported in Vite, Rollup, and esbuild.

```javascript
// webpack.config.js
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
const { sentryWebpackPlugin } = require("@sentry/bundler-plugins/webpack");

module.exports = {
devtool: "hidden-source-map", // Source map generation must be turned on ("hidden-source-map", "source-map", etc.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ This integration can be very helpful in reducing noise that's not related to you

<Alert>

**Prerequisite**: To use the `thirdPartyErrorFilterIntegration`, ensure you are using a bundler and one of [Sentry's bundler plugins](https://github.com/getsentry/sentry-javascript-bundler-plugins). For **Next.js**, set the [`applicationKey`](/platforms/javascript/guides/nextjs/configuration/build/#applicationKey) build option, which works for both Webpack and Turbopack builds.
**Prerequisite**: To use the `thirdPartyErrorFilterIntegration`, ensure you are using a bundler and one of <PlatformLink to="/sourcemaps/uploading/bundler-plugin-options/#applicationKey">Sentry's bundler plugins</PlatformLink>. For **Next.js**, set the [`applicationKey`](/platforms/javascript/guides/nextjs/configuration/build/#applicationKey) build option, which works for both Webpack and Turbopack builds.

</Alert>

Expand Down
13 changes: 7 additions & 6 deletions docs/platforms/javascript/common/configuration/tree-shaking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ If you're using one of our bundler plugins, you can use the `bundleSizeOptimizat

<PlatformCategorySection supported={['browser']}>
```javascript
// For example, the @sentry/webpack-plugin passed to the webpack config
// For example, the @sentry/bundler-plugins/webpack passed to the webpack config
sentryPlugin({
// other config
bundleSizeOptimizations: {
Expand All @@ -55,7 +55,7 @@ sentryPlugin({

<PlatformCategorySection supported={['server']}>
```javascript
// For example, the @sentry/webpack-plugin passed to the webpack config
// For example, the @sentry/bundler-plugins/webpack passed to the webpack config
sentryPlugin({
// other config
bundleSizeOptimizations: {
Expand All @@ -68,10 +68,11 @@ sentryPlugin({

For more details, see the documentation for the specific bundler plugin you're using:

- [Sentry Webpack Plugin](https://www.npmjs.com/package/@sentry/webpack-plugin)
- [Sentry Vite Plugin](https://www.npmjs.com/package/@sentry/vite-plugin)
- [Sentry Esbuild Plugin](https://www.npmjs.com/package/@sentry/esbuild-plugin)
- [Sentry Rollup Plugin](https://www.npmjs.com/package/@sentry/rollup-plugin)
- <PlatformLink to="/sourcemaps/uploading/webpack/">Sentry Webpack Plugin</PlatformLink>
- <PlatformLink to="/sourcemaps/uploading/vite/">Sentry Vite Plugin</PlatformLink>
- <PlatformLink to="/sourcemaps/uploading/esbuild/">Sentry Esbuild Plugin</PlatformLink>
- <PlatformLink to="/sourcemaps/uploading/rollup/">Sentry Rollup Plugin</PlatformLink>
- <PlatformLink to="/sourcemaps/uploading/bundler-plugin-options/#bundle-size-optimizations">Bundler Plugin Options</PlatformLink>

</PlatformSection>

Expand Down
40 changes: 40 additions & 0 deletions docs/platforms/javascript/common/install/bundler.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Create a file named `instrument.(js|mjs)` in the root directory of your project

Add the Sentry plugin for your bundler to your build configuration. The plugin instruments your dependencies at build time, so the SDK no longer depends on `Sentry.init()` running before your other imports.

<PlatformSection notSupported={["javascript.hono"]}>

```javascript {tabTitle:Vite} {filename: vite.config.mjs}
import { sentryVitePlugin } from "@sentry/node/vite";

Expand Down Expand Up @@ -71,6 +73,44 @@ await esbuild.build({
});
```

</PlatformSection>

<PlatformSection supported={["javascript.hono"]}>

```javascript {tabTitle:Vite} {filename: vite.config.mjs}
import { sentryVitePlugin } from "@sentry/hono/node/vite";

export default {
plugins: [sentryVitePlugin()],
};
```

```javascript {tabTitle:Rollup} {filename: rollup.config.mjs}
import { sentryRollupPlugin } from "@sentry/hono/node/rollup";

export default {
plugins: [sentryRollupPlugin()],
};
```

```javascript {tabTitle:webpack} {filename: webpack.config.mjs}
import { sentryWebpackPlugin } from "@sentry/hono/node/webpack";

export default {
plugins: [sentryWebpackPlugin()],
};
```

```javascript {tabTitle:esbuild} {filename: build.mjs}
import { sentryEsbuildPlugin } from "@sentry/hono/node/esbuild";

await esbuild.build({
plugins: [sentryEsbuildPlugin()],
});
```

</PlatformSection>

## 3. Import Your Instrument File First

Import `instrument.(js|mjs)` at the very top of your application's entry point, before any other imports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ replayIntegration({
});
```

4. (optional) To reduce bundle size, you can now <PlatformLink to="/configuration/tree-shaking/">Tree Shake</PlatformLink> the default included worker script. If you are using one of the [Sentry Bundler Plugins](https://github.com/getsentry/sentry-javascript-bundler-plugins) (version 2.10.0 or later):
4. (optional) To reduce bundle size, you can now <PlatformLink to="/configuration/tree-shaking/">Tree Shake</PlatformLink> the default included worker script. If you are using one of the <PlatformLink to="/sourcemaps/uploading/bundler-plugin-options/#bundleSizeOptimizations.excludeReplayWorker">Sentry Bundler Plugins</PlatformLink> (version 2.10.0 or later):

```javascript
sentryPlugin({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,21 @@ SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
Install the Sentry Webpack plugin:

```shell {tabTitle:npm}
npm install @sentry/webpack-plugin --save-dev
npm install @sentry/bundler-plugins --save-dev
```

```shell {tabTitle:yarn}
yarn add @sentry/webpack-plugin --dev
yarn add @sentry/bundler-plugins --dev
```

```shell {tabTitle:pnpm}
pnpm add @sentry/webpack-plugin --save-dev
pnpm add @sentry/bundler-plugins --save-dev
```

Register the Sentry webpack plugin in your `webpack.config.js`:

```javascript {filename:webpack.config.js}
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
const { sentryWebpackPlugin } = require("@sentry/bundler-plugins/webpack");

module.exports = {
// ... other config above ...
Expand All @@ -110,30 +110,30 @@ module.exports = {
<Alert level="warning">
Generating source maps **may expose them to the public**, potentially causing your
source code to be leaked. You can prevent this by configuring your server to
deny access to `.js.map` files, or by using [Sentry Webpack Plugin's
`sourcemaps.filesToDeleteAfterUpload`](https://www.npmjs.com/package/@sentry/webpack-plugin#sourcemapsfilestodeleteafterupload)
deny access to `.js.map` files, or by using <PlatformLink to="/sourcemaps/uploading/bundler-plugin-options/#sourcemaps.filesToDeleteAfterUpload">Sentry Webpack Plugin's
`sourcemaps.filesToDeleteAfterUpload`</PlatformLink>
option to delete source maps after they've been uploaded to Sentry.
</Alert>

Learn more about configuring the plugin in our [Sentry webpack plugin documentation](https://www.npmjs.com/package/@sentry/webpack-plugin).
Learn more about configuring the plugin in our <PlatformLink to="/sourcemaps/uploading/bundler-plugin-options/">Sentry webpack plugin documentation</PlatformLink>.

### esbuild

Install the Sentry esbuild plugin:

```shell {tabTitle:npm}
npm install @sentry/esbuild-plugin --save-dev
npm install @sentry/bundler-plugins --save-dev
```

```shell {tabTitle:yarn}
yarn add @sentry/esbuild-plugin --dev
yarn add @sentry/bundler-plugins --dev
```

```shell {tabTitle:pnpm}
pnpm add @sentry/esbuild-plugin --save-dev
pnpm add @sentry/bundler-plugins --save-dev
```

Then, follow the [official Nx documentation](https://nx.dev/nx-api/angular/executors/browser-esbuild#examples) to register the Sentry esbuild plugin (`@sentry/esbuild-plugin`) in your `project.json` file. For example:
Then, follow the [official Nx documentation](https://nx.dev/nx-api/angular/executors/browser-esbuild#examples) to register the Sentry esbuild plugin (`@sentry/bundler-plugins/esbuild`) in your `project.json` file. For example:

```json {filename:project.json}
{
Expand All @@ -143,7 +143,7 @@ Then, follow the [official Nx documentation](https://nx.dev/nx-api/angular/execu
"options": {
"plugins": [
{
"path": "@sentry/esbuild-plugin",
"path": "@sentry/bundler-plugins/esbuild",
"options": {
"org": "___ORG_SLUG___",
"project": "___PROJECT_SLUG___",
Expand All @@ -160,8 +160,8 @@ Then, follow the [official Nx documentation](https://nx.dev/nx-api/angular/execu
<Alert level="warning">
Generating source maps **may expose them to the public**, potentially causing your
source code to be leaked. You can prevent this by configuring your server to
deny access to `.js.map` files, or by using [Sentry Esbuild Plugin's
`sourcemaps.filesToDeleteAfterUpload`](https://www.npmjs.com/package/@sentry/esbuild-plugin#sourcemapsfilestodeleteafterupload)
deny access to `.js.map` files, or by using <PlatformLink to="/sourcemaps/uploading/bundler-plugin-options/#sourcemaps.filesToDeleteAfterUpload">Sentry Esbuild Plugin's
`sourcemaps.filesToDeleteAfterUpload`</PlatformLink>
option to delete source maps after they've been uploaded to Sentry.
</Alert>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ Before you start configuring the source maps upload, make sure that you're [gene
Install the custom webpack builder for Angular and the Sentry webpack plugin:

```shell {tabTitle:npm}
npm install @angular-builders/custom-webpack @sentry/webpack-plugin --save-dev
npm install @angular-builders/custom-webpack @sentry/bundler-plugins --save-dev
```

```shell {tabTitle:yarn}
yarn add @angular-builders/custom-webpack @sentry/webpack-plugin --dev
yarn add @angular-builders/custom-webpack @sentry/bundler-plugins --dev
```

```shell {tabTitle:pnpm}
pnpm add @angular-builders/custom-webpack @sentry/webpack-plugin --save-dev
pnpm add @angular-builders/custom-webpack @sentry/bundler-plugins --save-dev
```

## Configure
Expand Down Expand Up @@ -97,7 +97,7 @@ SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
Register the Sentry Webpack plugin in your `webpack.config.js`:

```javascript {filename:webpack.config.js}
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
const { sentryWebpackPlugin } = require("@sentry/bundler-plugins/webpack");

module.exports = {
// ... other config above ...
Expand All @@ -119,7 +119,7 @@ module.exports = {
};
```

Learn more about configuring the plugin in our [Sentry webpack plugin documentation](https://www.npmjs.com/package/@sentry/webpack-plugin).
Learn more about configuring the plugin in our <PlatformLink to="/sourcemaps/uploading/bundler-plugin-options/">Sentry webpack plugin documentation</PlatformLink>.

### 3. Upload

Expand All @@ -139,7 +139,7 @@ We recommend running a production build to test your implementation.
<Alert level="warning">
Generating source maps **may expose them to the public**, potentially causing your
source code to be leaked. You can prevent this by configuring your server to
deny access to `.js.map` files, or by using [Sentry Webpack Plugin's
`sourcemaps.filesToDeleteAfterUpload`](https://www.npmjs.com/package/@sentry/webpack-plugin#sourcemapsfilestodeleteafterupload)
deny access to `.js.map` files, or by using <PlatformLink to="/sourcemaps/uploading/bundler-plugin-options/#sourcemaps.filesToDeleteAfterUpload">Sentry Webpack Plugin's
`sourcemaps.filesToDeleteAfterUpload`</PlatformLink>
option to delete source maps after they've been uploaded to Sentry.
</Alert>
Loading
Loading