Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/integrations/angular2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,14 @@ Then, in your main application file (where ``bootstrap`` is called, e.g. main.ts
]);

Once you've completed these two steps, you are done.

Webpack and Other Module Loaders
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In Webpack and other module loaders, you may need to use the require keyword to load Raven:

.. code-block:: js

import Raven = require('raven-js');
.config('__PUBLIC_DSN__')
.install();
6 changes: 3 additions & 3 deletions typescript/raven-tests.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Raven, {RavenOptions} from '..';
import Raven = require('..');

Raven.config('https://public@getsentry.com/1').install();

var options: RavenOptions = {
var options = {
Copy link
Contributor Author

@benvinegar benvinegar Jul 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot explicitly declare things as RavenOptions any more (exporting this depended on default export support), but it will still be type-checked since it is passed as a parameter to Raven.config

logger: 'my-logger',
ignoreUrls: [
/graph\.facebook\.com/i,
Expand All @@ -22,7 +22,7 @@ var options: RavenOptions = {
]
};

Raven.config('https://public@getsentry.com/1', 1).install();
Raven.config('https://public@getsentry.com/1', options).install();

var throwsError = () => {
throw new Error('broken');
Expand Down
6 changes: 3 additions & 3 deletions typescript/raven.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

declare var Raven: RavenStatic;

export default Raven;
export = Raven;

export interface RavenOptions {
interface RavenOptions {
/** The log level associated with this event. Default: error */
level?: string;

Expand Down Expand Up @@ -54,7 +54,7 @@ export interface RavenOptions {
transport?: (options: RavenTransportOptions) => void;
}

export interface RavenStatic {
interface RavenStatic {

/** Raven.js version. */
VERSION: string;
Expand Down