Concatenate sources and inlined sourcemaps into a new generated sourcemap. Only inline sourcemaps are processed - external sourcemap references are discarded.
var SourceMapConcat = require('inline-sourcemap-concat')
Returns an instance of SourceMapConcat.SourceMap
.
Optionally pass in:
opts.baseDir
- a string of the base directory from which to resolve the sourcemap sources.opts.cache
- an object mapping sources to their encoder-differential state.opts.mapCommentType
- defaults toline
. will generate sourcemaps with//#
, any other value will generate sourcemaps with/*# */
.opts.mapCommentCharset
- defaults toutf-8
.opts.sourceRoot
- a string of the sourcemapsourceRoot
.opts.file
- a string of the sourcemapfile
.
Available methods:
sm.addFileSource(filename, source)
- append a file and its inlined sourcemap if available. returnssource
with the sourcemap comment removed.sm.addSpace(source)
- append files that don't have their own source mapping, but need to push the line/column count.sm.comment()
- return the sourcemap comment.sm.generate()
- return the sources and the sourcemap comment.
A reference to lydell's source-map-url.
This library is mostly based on the work of ef4's fast-sourcemap-concat.
The base64-vlq library is from mozilla's source-map.