Backtrace Rollup plugin
npm install @backtrace/rollup-pluginIf you're using rollup as your project bundler, you can use @backtrace/rollup-plugin to automate working with
sourcemaps.
(Source Map feature documentation)
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.
A specific URL is required to upload source maps. Follow
these instructions to create an upload URL
for the sourcemap endpoint with a symbol-post token.
`bash`
> npm install --save-dev @backtrace/rollup-plugin
`js
import { BacktracePlugin } from '@backtrace/rollup-plugin';
// or
const { BacktracePlugin } = require('@backtrace/rollup-plugin');
module.exports = {
// other configuration
plugins: [
new BacktracePlugin({
// enable upload only on production builds
uploadUrl: process.env.NODE_ENV === 'production' ? '
}),
],
};
``