Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chemzqm/stack-source-map
Add source map support for error stack (Chrome only)
https://github.com/chemzqm/stack-source-map
chrome sourcemap webpack
Last synced: 2 months ago
JSON representation
Add source map support for error stack (Chrome only)
- Host: GitHub
- URL: https://github.com/chemzqm/stack-source-map
- Owner: chemzqm
- Created: 2015-11-23T16:26:55.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-22T11:17:50.000Z (over 6 years ago)
- Last Synced: 2024-05-21T18:31:59.227Z (7 months ago)
- Topics: chrome, sourcemap, webpack
- Language: JavaScript
- Size: 43.9 KB
- Stars: 98
- Watchers: 5
- Forks: 9
- Open Issues: 59
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Stack-source-map
Attamp to make error stack works with source-map in browser, only Chrome supportted yet.
The code mostly from [evanw/node-source-map-support](https://github.com/evanw/node-source-map-support), but simplified to works with browser only and fixed to support all source map mode of [webpack](https://webpack.github.io/docs/configuration.html#devtool)
Basically, it's some kind hack of v8 [message.js](https://code.google.com/p/v8/source/browse/trunk/src/messages.js)
Works with babel and webpack :smiley:
## Install
npm install stack-source-map
## Usage
``` js
require('stack-source-map')()
```## entry for webpack
``` js
var entry = [
'stack-source-map/register'
// other entries
...
]
```## Use standalond file
Include file `stacksourmap.js` in your page, and add one line code:
``` js
StackSourceMap()
```## API
### stackSourceMap([option])
* `option.empty` empty cache between operations if true, default false
## Test babel with webpack
npm install
node server
open http://localhost:8080/bundle## License
MIT