src/vuegister.js
function generateMap(content, file, offset) {
  if (offset <= 0) {
    throw new RangeError('Offset parameter should be greater than zero.');
  }

  let generator = new sourceMap.SourceMapGenerator();
  let options = {
    locations: true,
    sourceType: 'module',
  };

  for (let token of tokenizer(content, options)) {
    let position = token.loc.start;

    generator.addMapping({
      source: file,
      original: {line: position.line + offset, column: position.column},
      generated: position,
      name: token.value,
    });
  }

  return generator.toJSON();
}
function generateMap(content, file, offset) {
  if (offset <= 0) {
    throw new RangeError('Offset parameter should be greater than zero.');
  }

  let generator = new sourceMap.SourceMapGenerator();
  let options = {
    locations: true,
    sourceType: 'module',
  };

  for (let token of tokenizer(content, options)) {
    let position = token.loc.start;

    generator.addMapping({
      source: file,
      original: {line: position.line + offset, column: position.column},
      generated: position,
      name: token.value,
    });
  }

  return generator.toJSON();
}
function generateMap ( content , file , offset ) { if ( offset <= 0 ) { throw new RangeError ( 'Offset parameter should be greater than zero.' ) ; } let generator = new sourceMap . SourceMapGenerator ( ) ; let options = { locations : true , sourceType : 'module' , } ; for ( let token of tokenizer ( content , options ) ) { let position = token . loc . start ; generator . addMapping ( { source : file , original : { line : position . line + offset , column : position . column } , generated : position , name : token . value , } ) ; } return generator . toJSON ( ) ; }
Generates source map for JavaScript.

@param {string} content - Content of the script tag.
@param {string} file - File name of the generated source.
@param {number} offset - Offset for script tag
@return {object} Returns the source map.
Generates source map for JavaScript .