Skip to content

sourceURL in non-eval sources #125

Open
@nicolo-ribaudo

Description

@legendecas can give more info, but it looks like Node.js is using //#sourceURL to map "virtual" files (created by transpiling TS on-the-fly) to their original filenames, without using a full source map. This is possible because in their implementation all the JS tokens are still in the original position, so mapping locations is not actually needed.

Does our spec support this use case, or does it only support the comment in eval()? In https://tc39.es/source-map/#linking-evald-code-to-named-generated-code says that it's for eval()'ed code, while in https://tc39.es/source-map/#linking-generated-code it also mentions it for "normal scripts".

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions