1.0.5 • Published 2 years ago

glov-build-sourcemap v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Sourcemap handling helpers for glov-build tasks

API usage:

const sourcemap = require('glov-build-sourcemap');

sourcemap.init(job, file, (err, map, raw_sourcemap_file, stripped_source) => {});

// Outputs both the file (contents) and sourcemap, as either two files or inlined together
sourcemap.out(job, { relative, contents, map, inline });

// Returns a map with it's `mappings` decoded into numbers
// After decoding, format is as follows (anything beyond first entry in the array is optional)
//   map.mappings[mapped linenum][idx] = [ mapped char offset, source file index, source line, char start, name index]
map = sourcemap.decode(map)
// Encodes numerical mappings into sourcemap format
map = sourcemap.encode(filename, map);