Skip to content

Commit e2dd940

Browse files
committed
Merge pull request #53 from julien-f/register-module
`register` module (fix #52)
2 parents 67ee8f1 + 40e140a commit e2dd940

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@ Source maps can be generated using libraries such as [source-map-index-generator
1515

1616
The path should either be absolute or relative to the compiled file.
1717

18+
It is also possible to to install the source map support directly by
19+
requiring the `register` module which can be handy with ES6:
20+
21+
```javascript
22+
import 'source-map-support/register'
23+
24+
// Instead of:
25+
import sourceMapSupport from 'source-map-support'
26+
sourceMapSupport.install()
27+
```
28+
29+
It is also very useful with Mocha:
30+
31+
```
32+
mocha --require source-map-support/register tests/
33+
```
34+
1835
#### Browser support
1936

2037
This library also works in Chrome. While the DevTools console already supports source maps, the V8 engine doesn't and `Error.prototype.stack` will be incorrect without this library. Everything will just work if you deploy your source files using [browserify](http://browserify.org/). Just make sure to pass the `--debug` flag to the browserify command so your source maps are included in the bundled code.

register.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require('./').install();

0 commit comments

Comments
 (0)