source-map-to-comment
Convert a Source Map object to a comment
Install
$ npm install source-map-to-comment
Usage
import sourceMapToComment from 'source-map-to-comment';
const sourceMap = getSourceMapObjectFromSomething();
sourceMapToComment(sourceMap);
//=> '//# sourceMappingURL=data:application/json;base64,eyJ2Z...'
sourceMapToComment(JSON.stringify(sourceMap));
//=> '//# sourceMappingURL=data:application/json;base64,eyJ2Z...'
sourceMapToComment(sourceMap, {type: 'css'});
//=> '/*# sourceMappingURL=data:application/json;base64,eyJ2Z... */'