@txlemetry/rollup-plugin
v1.4.1
Published
Txlemetry Rollup plugin
Readme
@txlemetry/rollup-plugin
Rollup plugin for uploading source maps to Txlemetry for error tracking.
Installation
npm install @txlemetry/rollup-plugin --save-devUsage
Add the plugin to your Rollup configuration:
import txlemetryRollupPlugin from '@txlemetry/rollup-plugin'
export default {
input: './src/index.ts',
output: {
format: 'es',
dir: 'dist',
},
plugins: [
txlemetryRollupPlugin({
personalApiKey: process.env.TXLEMETRY_PERSONAL_API_KEY,
projectId: process.env.TXLEMETRY_PROJECT_ID,
sourcemaps: {
enabled: true,
releaseName: 'my-app',
releaseVersion: '1.0.0',
},
}),
],
}Configuration Options
| Option | Type | Required | Default | Description |
| ------------------------------ | ---------------------------------------------------- | -------- | --------------------------- | ------------------------------------------- |
| personalApiKey | string | Yes | - | Your Txlemetry personal API key |
| projectId | string | Yes | - | Your Txlemetry project/environment ID |
| envId | string | No | - | Deprecated alias for projectId |
| host | string | No | https://app.txlemetry.com | Txlemetry instance host |
| logLevel | 'debug' \| 'info' \| 'warn' \| 'error' \| 'silent' | No | 'info' | Logging verbosity |
| cliBinaryPath | string | No | Auto-detected | Path to the Txlemetry CLI binary |
| sourcemaps.enabled | boolean | No | true | Enable source map processing |
| sourcemaps.releaseName | string | No | - | Release name for source map grouping |
| sourcemaps.releaseVersion | string | No | - | Version identifier for the release |
| sourcemaps.deleteAfterUpload | boolean | No | true | Delete source maps after upload |
| sourcemaps.batchSize | number | No | - | Number of source maps to upload in parallel |
Full Example
import txlemetryRollupPlugin from '@txlemetry/rollup-plugin'
import packageJson from './package.json' with { type: 'json' }
export default {
input: './src/index.ts',
output: [
{
format: 'es',
dir: 'dist/esm',
},
],
plugins: [
txlemetryRollupPlugin({
personalApiKey: process.env.TXLEMETRY_PERSONAL_API_KEY,
projectId: process.env.TXLEMETRY_PROJECT_ID,
host: process.env.TXLEMETRY_API_HOST,
logLevel: 'info',
sourcemaps: {
enabled: true,
releaseName: packageJson.name,
releaseVersion: packageJson.version,
},
}),
],
}