diff --git a/tools/rollup-plugin/README.md b/tools/rollup-plugin/README.md new file mode 100644 index 00000000..0fae39bd --- /dev/null +++ b/tools/rollup-plugin/README.md @@ -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" ? "" : undefined + })] +} +``` \ No newline at end of file diff --git a/tools/vite-plugin/README.md b/tools/vite-plugin/README.md new file mode 100644 index 00000000..d73b5995 --- /dev/null +++ b/tools/vite-plugin/README.md @@ -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" ? "" : undefined + })] +} +``` \ No newline at end of file diff --git a/tools/webpack-plugin/README.md b/tools/webpack-plugin/README.md new file mode 100644 index 00000000..c7a33550 --- /dev/null +++ b/tools/webpack-plugin/README.md @@ -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" ? "" : undefined + })] +} +``` \ No newline at end of file