Ember CLI Deploy plugin to upload source maps to New Relic.
A plugin is an addon that can be executed as a part of the ember-cli-deploy pipeline. A plugin will implement one or more of the ember-cli-deploy's pipeline hooks.
For more information on what plugins are and how they work, please refer to the Plugin Documentation.
To get up and running quickly, do the following:
-
Ensure ember-cli-deploy-build is installed and configured.
-
Install this plugin
$ ember install ember-cli-deploy-new-relic-sourcemap
- Place the following configuration into
config/deploy.js
ENV['new-relic-sourcemap'] = {
// The URL or CDN your assets are served from.
// Likely the same as the `prepend` in your fingerprint config
prefix: 'https://your.awesome.site',
// Application ID Provided by New Relic
applicationID: '12345678',
// Admin Key (not application-specific)
nrAdminKey: 'a98b7a98notd7reallyasda9s8fkey7am'
};
- Enable sourcemaps in your
ember-cli-build.js
file
const app = new EmberApp(defaults, {
sourcemaps: {
enabled: true
}
});
- Enable fingerprinting. (While New Relic supports non-fingerprinted assets, this is not supported by this plugin yet).
const app = new EmberApp(defaults, {
fingerprint: {
enabled: true
}
});
- Important: Ensure that your Source Maps are not Gzipped if you are using
ember-cli-deploy-gzip
Run the following command in your terminal:
ember install ember-cli-deploy-new-relic-sourcemap
For general information on how to setup New Relic Sourcemaps, please refer to their API documentation.
For detailed information on what plugin hooks are and how they work, please refer to the Plugin Documentation.
configure
upload
For detailed information on what plugin hooks are and how they work, please refer to the Plugin Documentation.
This is the base URL where your normal javascript assets are served from. (This is likely the same value as what you configure in your fingerprint.prepend
setting, if applicable). The fully qualified URL is the only way New Relic knows to map an stack frame to a source map.
Required
The New Reclic provided ID for the application for which the source maps are being uploaded.
Required
The New Relic provided Admin Key (this is different than the key used to report errors to New Relic).
Required
The minimatch
expression to determine which source map files should be uploaded.
Default: '**/*.map'
The root directory that all files matching the filePattern
will be uploaded from. By default, this option will use the distDir
property of the deployment context.
Default: context.distDir
The following properties are expected to be present on the deployment context
object:
distDir
(provided by ember-cli-deploy-build)