4

I just only want to have a ready to use compiled plain javascript file from this repository https://github.com/airbrake/airbrake-js

How to make it? It drives me crazy, I don't wan't any bower, npm or whatever - just ONE plain javascript file

BTW: The file "https://raw.githubusercontent.com/airbrake/airbrake-js/master/dist/client.js" is not what I want to have, cuz there is still a "require('./internal/compat');" inside ;-)

greetings

Alex Xela
  • 41
  • 2

3 Answers3

1

Use the tree system available on the github page to navigate to the files you want and then click on the view button and then raw to get the source code for that file without all of the line numbers.

Glen
  • 344
  • 1
  • 14
  • dude, I dont wan't to know how to navigate through a file in github-- i need to know how to compile this js file: https://raw.githubusercontent.com/airbrake/airbrake-js/master/dist/client.js to a single and plain js file; wihtout any "require('./internal/compat');" or anythin else inseide ;-) – Alex Xela Jul 13 '15 at 10:34
1

Get/Download/Copy those two files and include them in your HTML:

https://raw.githubusercontent.com/airbrake/airbrake-js/master/dist/client.js https://raw.githubusercontent.com/airbrake/airbrake-js/master/dist/instrumentation/jquery.js

<script src="js/airbrake-js/client.js"></script>
<script src="js/airbrake-js/instrumentation/jquery.js"></script>

Please check also legacy example:

After adding the files add this script too:

var airbrake = new airbrakeJs.Client({projectId: 1, projectKey: 'abc'});
if (window.jQuery) {
  airbrakeJs.instrumentation.jquery(airbrake, jQuery);
}

try {
  throw new Error('hello from airbrake-js');
} catch (err) {
  airbrake.push(err);
}
michelem
  • 14,430
  • 5
  • 50
  • 66
  • but in this file is stil **"require('./internal/compat');"** and other require statements inside. I need the file filled up with the requires files. – Alex Xela Jul 13 '15 at 10:38
  • Answer updated, I'd like to suggest you to read the Github README and look at examples. – michelem Jul 13 '15 at 10:42
  • please take a look at line 5 in https://raw.githubusercontent.com/airbrake/airbrake-js/master/dist/client.js ...how to resolve this damn "require('./internal/compat');" ????????????? I'able to read the readme!!! whats about the "require('./internal/compat');" ???????????? – Alex Xela Jul 13 '15 at 10:45
0

If you are going to use this code from the browser, it is expected that you will be using browserify: http://browserify.org/

Browsers don't have the require method defined, but Node.js does. With Browserify you can write code that uses require in the same way that you would use it in Node.

Ricky Nelson
  • 876
  • 10
  • 24