UNPKG

orionsoft-react-scripts

Version:

Orionsoft Configuration and scripts for Create React App.

29 lines (22 loc) 576 B
'use strict'; var _require = require('source-map'); var SourceMapGenerator = _require.SourceMapGenerator; function makeIdentitySourceMap(content, resourcePath) { var map = new SourceMapGenerator(); map.setSourceContent(resourcePath, content); content.split('\n').forEach(function (line, index) { map.addMapping({ source: resourcePath, original: { line: index + 1, column: 0 }, generated: { line: index + 1, column: 0 } }); }); return map.toJSON(); } module.exports = makeIdentitySourceMap;