开发者社区> 镜像站> NPM> generate-sourcemap
generate-sourcemap
Generates a source map for files that were packed into a bundle.
Last updated 8 years ago by thlorenz .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install generate-sourcemap 
SYNC missed versions from official npm registry.

generate sourcemap build status

Generates a source map for files that were packed into a bundle.

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"}

Current Tags

  • 0.1.0                                ...           latest (8 years ago)

1 Versions

  • 0.1.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (1)