Skip to content

Commit a6408e4

Browse files
authored
Merge pull request #97 from backtrace-labs/rick/sourcemap-readmes
Add webpack readme
2 parents 2ab4feb + 184ab33 commit a6408e4

File tree

3 files changed

+137
-0
lines changed

3 files changed

+137
-0
lines changed

tools/rollup-plugin/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# @backtrace-labs/rollup-plugin
2+
If you're using rollup as your project bundler, you can use `@backtrace-labs/rollup-plugin` to automate working with sourcemaps.
3+
4+
[(Source Map feature documentation)](https://docs.saucelabs.com/error-reporting/platform-integrations/source-map/)
5+
6+
## Enable Source Maps for Your Application
7+
8+
Set `sourcemap` in `output` to `true` in your `rollup.config.js`:
9+
10+
```js
11+
module.exports = {
12+
build: {
13+
sourcemap: true
14+
}
15+
}
16+
```
17+
18+
If you're using code transpiler plugins (such as Typescript), ensure to enable source-mapping there as well.
19+
20+
## Set up `@backtrace-labs/rollup-plugin`
21+
22+
### Construct an upload URL
23+
24+
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.
25+
26+
### Install `@backtrace-labs/rollup-plugin` as a developer dependency:
27+
28+
```bash
29+
> npm install --save-dev @backtrace-labs/rollup-plugin
30+
```
31+
32+
### Add it to your `plugins` array in `rollup.config.js`:
33+
34+
```js
35+
import { BacktracePlugin } from '@backtrace-labs/rollup-plugin';
36+
// or
37+
const { BacktracePlugin } = require('@backtrace-labs/rollup-plugin');
38+
39+
module.exports = {
40+
// other configuration
41+
plugins: [new BacktracePlugin({
42+
// enable upload only on production builds
43+
uploadUrl: process.env.NODE_ENV === "production" ? "<your upload URL>" : undefined
44+
})]
45+
}
46+
```

tools/vite-plugin/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# @backtrace-labs/vite-plugin
2+
If you're using Vite as your project bundler, you can use `@backtrace-labs/vite-plugin` to automate working with sourcemaps.
3+
4+
[(Source Map feature documentation)](https://docs.saucelabs.com/error-reporting/platform-integrations/source-map/)
5+
6+
## Enable Source Maps for Your Application
7+
8+
Set `sourcemap` in `output` to `true` in your `vite.config.js`:
9+
10+
```js
11+
module.exports = {
12+
build: {
13+
sourcemap: true
14+
}
15+
}
16+
```
17+
18+
If you're using code transpiler plugins (such as Typescript), ensure to enable source-mapping there as well.
19+
20+
## Set up `@backtrace-labs/vite-plugin`
21+
22+
### Construct an upload URL
23+
24+
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.
25+
26+
### Install `@backtrace-labs/vite-plugin` as a developer dependency:
27+
28+
```bash
29+
> npm install --save-dev @backtrace-labs/vite-plugin
30+
```
31+
32+
### Add it to your `plugins` array in `vite.config.js`:
33+
34+
```js
35+
import { BacktracePlugin } from '@backtrace-labs/vite-plugin';
36+
// or
37+
const { BacktracePlugin } = require('@backtrace-labs/vite-plugin');
38+
39+
module.exports = {
40+
// other configuration
41+
plugins: [new BacktracePlugin({
42+
// enable upload only on production builds
43+
uploadUrl: process.env.NODE_ENV === "production" ? "<your upload URL>" : undefined
44+
})]
45+
}
46+
```

tools/webpack-plugin/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# @backtrace-labs/webpack-plugin
2+
If you're using Webpack as your project bundler, you can use `@backtrace-labs/webpack-plugin` to automate working with sourcemaps.
3+
4+
[(Source Map feature documentation)](https://docs.saucelabs.com/error-reporting/platform-integrations/source-map/)
5+
6+
## Enable Source Maps for Your Application
7+
8+
Set `devtool` to `source-map` in your `webpack.config.js`:
9+
10+
```js
11+
module.exports = {
12+
devtool: 'source-map',
13+
// other configuration
14+
}
15+
```
16+
17+
If you're using code transpiler plugins (such as Typescript), ensure to enable `source-mapping` there as well.
18+
19+
## Set up `@backtrace-labs/webpack-plugin`
20+
21+
### Construct an upload URL
22+
23+
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.
24+
25+
### Install `@backtrace-labs/webpack-plugin` as a developer dependency:
26+
27+
```bash
28+
> npm install --save-dev @backtrace-labs/webpack-plugin
29+
```
30+
31+
### Add it to your `plugins` array in `webpack.config.js`:
32+
33+
```js
34+
import { BacktracePlugin } from '@backtrace-labs/webpack-plugin';
35+
// or
36+
const { BacktracePlugin } = require('@backtrace-labs/webpack-plugin');
37+
38+
module.exports = {
39+
// other configuration
40+
plugins: [new BacktracePlugin({
41+
// enable upload only on production builds
42+
uploadUrl: process.env.NODE_ENV === "production" ? "<your upload URL>" : undefined
43+
})]
44+
}
45+
```

0 commit comments

Comments
 (0)