`generatedPositionFor` accepts a position in one of the sourcemap's *input* source files. Therefore the `source` path should be one of the sourcemap's input `sources`, not the output `file`.
babel-core
Babel compiler core.
Install
$ npm install babel-core
Usage
import babel from 'babel-core';
const code = `class Example {}`;
const result = babel.transform(code, { /* options */ });
result.code; // Generated code
result.map; // Sourcemap
result.ast; // AST
For more in depth documentation see: http://babeljs.io/docs/usage/api/