Skip to content

Accept Input Source Maps #13944

Open
Open
@LucasSloan

Description

The typescript compiler produces sources maps mapping from the javascript it produces to the typescript sources it compiled. This is great, but doesn't go far enough if there are tools which generate the sources that are consumed by the typescript compiler.

For example, Tsickle preprocesses typescript sources before passing them to the typescript compiler. As things stand we've had to implement a hack to get our source maps to work. We use a compiler host which performs the tsickle transforms as the typescript compiler reads files, saves the resulting source maps and then compose them with the source maps produced by the typescript compiler as they're emitted.

Instead the typescript compiler could accept source maps as input alongside sources, and compose the input source maps with the source maps produced by the compiler.

The ideal api would be that the typescript compiler would look for either a. an inline source map as a comment in the source file or b. a file in the same directory with the name {source file name}.ts.map, which shouldn't require any crazy file resolution.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    In DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions