Merge pull request #53 from julien-f/register-module

`register` module (fix #52)
This commit is contained in:
Joe Esposito 2015-05-15 12:33:05 -04:00
commit e2dd940d37
2 changed files with 18 additions and 0 deletions

View File

@ -15,6 +15,23 @@ Source maps can be generated using libraries such as [source-map-index-generator
The path should either be absolute or relative to the compiled file. The path should either be absolute or relative to the compiled file.
It is also possible to to install the source map support directly by
requiring the `register` module which can be handy with ES6:
```javascript
import 'source-map-support/register'
// Instead of:
import sourceMapSupport from 'source-map-support'
sourceMapSupport.install()
```
It is also very useful with Mocha:
```
mocha --require source-map-support/register tests/
```
#### Browser support #### Browser support
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. 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.

1
register.js Normal file
View File

@ -0,0 +1 @@
require('./').install();