Skip to content
Merged
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
46 changes: 46 additions & 0 deletions tools/rollup-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# @backtrace-labs/rollup-plugin
If you're using rollup as your project bundler, you can use `@backtrace-labs/rollup-plugin` to automate working with sourcemaps.

[(Source Map feature documentation)](https://docs.saucelabs.com/error-reporting/platform-integrations/source-map/)

## Enable Source Maps for Your Application

Set `sourcemap` in `output` to `true` in your `rollup.config.js`:

```js
module.exports = {
build: {
sourcemap: true
}
}
```

If you're using code transpiler plugins (such as Typescript), ensure to enable source-mapping there as well.

## Set up `@backtrace-labs/rollup-plugin`

### Construct an upload URL

A specific URL is required to upload source maps. Follow [these instructions](https://docs.saucelabs.com/error-reporting/project-setup/submission-url/) to create an upload URL for the `sourcemap` endpoint with a `symbol-post` token.

### Install `@backtrace-labs/rollup-plugin` as a developer dependency:

```bash
> npm install --save-dev @backtrace-labs/rollup-plugin
```

### Add it to your `plugins` array in `rollup.config.js`:

```js
import { BacktracePlugin } from '@backtrace-labs/rollup-plugin';
// or
const { BacktracePlugin } = require('@backtrace-labs/rollup-plugin');

module.exports = {
// other configuration
plugins: [new BacktracePlugin({
// enable upload only on production builds
uploadUrl: process.env.NODE_ENV === "production" ? "<your upload URL>" : undefined
})]
}
```
46 changes: 46 additions & 0 deletions tools/vite-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# @backtrace-labs/vite-plugin
If you're using Vite as your project bundler, you can use `@backtrace-labs/vite-plugin` to automate working with sourcemaps.

[(Source Map feature documentation)](https://docs.saucelabs.com/error-reporting/platform-integrations/source-map/)

## Enable Source Maps for Your Application

Set `sourcemap` in `output` to `true` in your `vite.config.js`:

```js
module.exports = {
build: {
sourcemap: true
}
}
```

If you're using code transpiler plugins (such as Typescript), ensure to enable source-mapping there as well.

## Set up `@backtrace-labs/vite-plugin`

### Construct an upload URL

A specific URL is required to upload source maps. Follow [these instructions](https://docs.saucelabs.com/error-reporting/project-setup/submission-url/) to create an upload URL for the `sourcemap` endpoint with a `symbol-post` token.

### Install `@backtrace-labs/vite-plugin` as a developer dependency:

```bash
> npm install --save-dev @backtrace-labs/vite-plugin
```

### Add it to your `plugins` array in `vite.config.js`:

```js
import { BacktracePlugin } from '@backtrace-labs/vite-plugin';
// or
const { BacktracePlugin } = require('@backtrace-labs/vite-plugin');

module.exports = {
// other configuration
plugins: [new BacktracePlugin({
// enable upload only on production builds
uploadUrl: process.env.NODE_ENV === "production" ? "<your upload URL>" : undefined
})]
}
```
45 changes: 45 additions & 0 deletions tools/webpack-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# @backtrace-labs/webpack-plugin
If you're using Webpack as your project bundler, you can use `@backtrace-labs/webpack-plugin` to automate working with sourcemaps.

[(Source Map feature documentation)](https://docs.saucelabs.com/error-reporting/platform-integrations/source-map/)

## Enable Source Maps for Your Application

Set `devtool` to `source-map` in your `webpack.config.js`:

```js
module.exports = {
devtool: 'source-map',
// other configuration
}
```

If you're using code transpiler plugins (such as Typescript), ensure to enable `source-mapping` there as well.

## Set up `@backtrace-labs/webpack-plugin`

### Construct an upload URL

A specific URL is required to upload source maps. Follow [these instructions](https://docs.saucelabs.com/error-reporting/project-setup/submission-url/) to create an upload URL for the `sourcemap` endpoint with a `symbol-post` token.

### Install `@backtrace-labs/webpack-plugin` as a developer dependency:

```bash
> npm install --save-dev @backtrace-labs/webpack-plugin
```

### Add it to your `plugins` array in `webpack.config.js`:

```js
import { BacktracePlugin } from '@backtrace-labs/webpack-plugin';
// or
const { BacktracePlugin } = require('@backtrace-labs/webpack-plugin');

module.exports = {
// other configuration
plugins: [new BacktracePlugin({
// enable upload only on production builds
uploadUrl: process.env.NODE_ENV === "production" ? "<your upload URL>" : undefined
})]
}
```