Skip to content

Latest commit

 

History

History
50 lines (40 loc) · 1.5 KB

README.md

File metadata and controls

50 lines (40 loc) · 1.5 KB

New Relic script tag for the HTML Webpack Plugin

Add new relic script tag using html-webpack-plugin.

Installation

You must be running webpack on node 8.x or higher

Install the plugin with yarn:

$ yarn -D html-webpack-new-relic-plugin

Or npm:

$ npm install --save-dev html-webpack-new-relic-plugin

Basic Usage

Require the plugin in your webpack config:

var HtmlWebpackNewRelicPlugin = require('html-webpack-new-relic-plugin');

Add the plugin to your webpack config:

plugins: [
  new HtmlWebpackPlugin(),
  new HtmlWebpackNewRelicPlugin({
    accountID: '121212',
    agentID: '343434',
    trustKey: '565656',
    licenseKey: '123456',
    applicationID: '654321'
  })
]  

This plugin adds the script for New Relic "Pro + SPA" instrumentation. If you have "Pro" configured under Browser => "Application settings", the SPA data will be collected, but dropped by New Relic during ingestion. SPA data will be ready to be ingested when and if you switch to "Pro + SPA" instrumentation. The plugin option values can be found at the bottom of the JavaScript snippet under these settings.

This plugin will add the HUGE New Relic script tag to your html file without making your template file ugly. It suits best using with html-webpack-template because you actually don't need a template file.