Install the plugin with npm:
$ npm install rollbar-deploy-webpack-plugin --save-dev
An example webpack.config.js:
const RollbarDeployPlugin =const PUBLIC_PATH = ''const webpackConfig =entry: 'index'publicPath: PUBLIC_PATHoutput:path: 'dist'filename: 'index-[hash].js'plugins:accessToken: 'aaaabbbbccccddddeeeeffff00001111'environment: 'production'revision: 'version_string_here' // would typically be the git hashlocalUsername: 'user' // whoever has done the deploy
You can pass a hash of configuration options to
Allowed values are as follows:
accessToken: string (required)
post_server_item access token.
revision: string (required)
A string identifying the version of your code this deployment is for. Typically this will be the full git sha.
environment: string (required)
Environment to which the revision was deployed. E.g. 'production', 'development', 'testing' etc.
localUsername: string | [string] (optional)
Local username of person who deployed the script. Visible in web application.
silent: boolean (default:
false, success and warning messages will be logged to the console for each upload. Note: if you also do not want to see errors, set the
ignoreErrors option to
ignoreErrors: boolean (default:
true to bypass adding upload errors to the webpack compilation. Do this if you do not want to fail the build when the deployment upload fails. If you do not want to fail the build but you do want to see the failures as warnings, make sure
silent option is set to
rollbarEndpoint: string (default:
A string defining the Rollbar API endpoint to upload the deployment to. It can be used for self-hosted Rollbar instances.
- The web app should have rollbar-browser installed and configured for webpack as described here.
- See the Rollbar deploy tracking documentation for how to configure the client side for deployment support.
- More general info on the using Rollbar for browser JS.
See the Contributors Guide