Skip to content

Commit 05ebd04

Browse files
authored
No default export for TypeScript bindings, add Webpack instructions (#645)
1 parent 879ec45 commit 05ebd04

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

docs/integrations/angular2.rst

+11
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,14 @@ Then, in your main application file (where ``bootstrap`` is called, e.g. main.ts
7272
]);
7373
7474
Once you've completed these two steps, you are done.
75+
76+
Webpack and Other Module Loaders
77+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78+
79+
In Webpack and other module loaders, you may need to use the require keyword to load Raven:
80+
81+
.. code-block:: js
82+
83+
import Raven = require('raven-js');
84+
.config('__PUBLIC_DSN__')
85+
.install();

typescript/raven-tests.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import Raven, {RavenOptions} from '..';
1+
import Raven = require('..');
22

33
Raven.config('https://[email protected]/1').install();
44

5-
var options: RavenOptions = {
5+
var options = {
66
logger: 'my-logger',
77
ignoreUrls: [
88
/graph\.facebook\.com/i,
@@ -22,7 +22,7 @@ var options: RavenOptions = {
2222
]
2323
};
2424

25-
Raven.config('https://[email protected]/1', 1).install();
25+
Raven.config('https://[email protected]/1', options).install();
2626

2727
var throwsError = () => {
2828
throw new Error('broken');

typescript/raven.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
declare var Raven: RavenStatic;
66

7-
export default Raven;
7+
export = Raven;
88

9-
export interface RavenOptions {
9+
interface RavenOptions {
1010
/** The log level associated with this event. Default: error */
1111
level?: string;
1212

@@ -54,7 +54,7 @@ export interface RavenOptions {
5454
transport?: (options: RavenTransportOptions) => void;
5555
}
5656

57-
export interface RavenStatic {
57+
interface RavenStatic {
5858

5959
/** Raven.js version. */
6060
VERSION: string;

0 commit comments

Comments
 (0)