Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sourceURL in non-eval sources #125

Open
nicolo-ribaudo opened this issue Sep 5, 2024 · 2 comments
Open

sourceURL in non-eval sources #125

nicolo-ribaudo opened this issue Sep 5, 2024 · 2 comments

Comments

@nicolo-ribaudo
Copy link
Member

@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".

@jkup
Copy link
Collaborator

jkup commented Sep 18, 2024

It does look to conflict a bit. I think we can loosen or remove the first link and have it not mention eval. I think it should just say we allow sourceUrl and it takes priority over source maps.

@legendecas
Copy link
Member

yeah, I think it is would be great to indicate that //#sourceURL can solely present in "normal scripts", without a //#sourceMappingURL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants