oxc
oxc copied to clipboard
Option to return declaration file maps from isolatedDeclaration
https://www.typescriptlang.org/tsconfig/#declarationMap
Generates a source map for .d.ts files which map back to the original .ts source file. This will allow editors such as VS Code to go to the original .ts file when using features like Go to Definition.
You should strongly consider turning this on if you’re using project references.
For the JavaScript API, oxc.transform
supports a boolean sourcemap
option, so it might make sense to do something similar for oxc.isolatedDeclaration
import oxc from 'oxc-transform';
const { sourceText, errors, sourceMap } = oxc.isolatedDeclaration(
"test.ts",
"class A {}",
{sourcemap: true},
);