Upload source maps to new relic as part of a webpack build.
yarn add new-relic-source-map-webpack-plugin --dev
npm install new-relic-source-map-webpack-plugin --save-dev
Instantiate the plugin and add it to your plugins array.
staticAssetUrl are required unless
true. Full list of options in the next section.
const NewRelicSourceMapPlugin = ;moduleexports =...webpackConfigplugins:...yourPluginsapplicationId: 'YOUR NEW RELIC APP ID'nrAdminKey: processenvNR_ADMIN_KEYstaticAssetUrl: ''noop: typeof processenvNR_ADMIN_KEY === 'undefined' // upload source maps in prod builds only
If you're using
releaseId, make sure one or both are unique per build and
that you use the
newrelic.addRelease method in your code to identify the release.
|applicationId||string||applicationId as defined here|
|nrAdminKey||string||Admin Key as defined here|
|staticAssetUrl||string||the domain your production assets are served from. Written as a complete url. Example: "https://www.examplecdn.com"|
|extensionRegex||regex||a regex used to find js files. Defaults to
|noop||boolean||control boolean that decides whether or not to run the plugin. Set to true for builds where you don't want to upload assets to new relic.|
|releaseName||string||[Optional] unique identifier for the release name|
|releaseId||string||[Optional] unique version for the release identifier|
|errorCallback||function||[Optional] A function for error callback. Default is