Any advice for using with requirejs

petetak

Posted on
Aug 14 2014

I'm trying to use the js lib with a backbone app that uses requirejs but Raygun.init always fails - has anyone got any advice around this setup please?


petetak

Posted on
Aug 14 2014

I solved this by using requirejs to include the module and then referring to Raygun like this: window.Raygun.init(........


IanDarling

Posted on
Aug 18 2014

I've set it up as the following if that helps:

requirejs.config({
  paths: {
   'jquery': '../lib/jquery/jquery-1.9.1',
   'raygun': '../lib/raygun/raygun'
  },
  shim: {
    'raygun': {
      deps: ['jquery'],
      exports: 'window.Raygun'
    }
  }
});
define(['raygun'], function(raygun) {
    raygun.init('key').attach();
});

Reply