0.2.0 • Published 10 years ago
inline-sourcemap-concat v0.2.0
inline-sourcemap-concat
Concatenate sources and inlined sourcemaps into a new generated sourcemap. Only inline sourcemaps are processed - external sourcemap references are discarded.
methods
var SourceMapConcat = require('inline-sourcemap-concat')var sm = SourceMapConcat.create(opts={})
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. returnssourcewith 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.
SourceMapConcat.srcURL
A reference to lydell's source-map-url.
Credits
This library is mostly based on the work of ef4's fast-sourcemap-concat.
The base64-vlq library is from mozilla's source-map.