Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thlorenz/generate-sourcemap
Generates a source map for files that were packed into a bundle.
https://github.com/thlorenz/generate-sourcemap
Last synced: about 2 months ago
JSON representation
Generates a source map for files that were packed into a bundle.
- Host: GitHub
- URL: https://github.com/thlorenz/generate-sourcemap
- Owner: thlorenz
- License: mit
- Created: 2013-03-05T04:01:51.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2022-06-01T15:14:10.000Z (over 2 years ago)
- Last Synced: 2024-11-02T01:42:04.527Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 11
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# generate sourcemap [![build status](https://secure.travis-ci.org/thlorenz/generate-sourcemap.png)](http://travis-ci.org/thlorenz/generate-sourcemap)
Generates a source map for files that were packed into a bundle.
```js
var create = require('generate-sourcemap');
var gen = create('bundle.js');
var ranges = [
{ sourceFile: 'foo.js', start: 3, end: 5 }
, { sourceFile: 'bar.js', start: 6, end: 15 }
];gen.addRanges(ranges);
console.log('source map for ranges:\n', ranges);
console.log('is: \n', gen.getMap());
```Output:
```
source map for ranges:
[ { sourceFile: 'foo.js', start: 3, end: 5 },
{ sourceFile: 'bar.js', start: 6, end: 15 } ]
is:
{"version":3,"file":"bundle.js","sources":["foo.js","bar.js"],"names":[],"mappings":";;;AAAA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
```