benjamn / recast

JavaScript syntax tree transformer, nondestructive pretty-printer, and automatic source map generator
MIT License
4.95k stars 346 forks source link

Empty sourcemaps with no mappings #1312

Open stereokai opened 1 year ago

stereokai commented 1 year ago
  recast.print(
    recast.visit(
      recast.parse(code, {
        parser: { /* ...options */ },
      }),
      {
        visitFunction: function (path) { body.unshift( /* ... */ ) }
      }
    ),
    {
      sourceFileName: basename(file),
      sourceMapName: basename(file) + ".map",
    }
  );

What could be the reason I'm getting empty sourcemaps with this code? Am I doing something wrong? (I redacted some code for your reading comfort)