Skip to content

Conversation

5im-0n
Copy link
Contributor

@5im-0n 5im-0n commented Sep 5, 2019

This commit adds a sourceURL directive to the generated template function.
This makes generated template code visible in the debugger.
See https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Debug_eval_sources

When loading templates dynamically in the browser (for example using ejs-render-remote) this simple addition is really useful:

firefox_80pYTdTkkL

This commit adds a sourceURL directive to the generated template function.
This makes generated template code visible in the debugger.
See https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Debug_eval_sources
@mde
Copy link
Owner

mde commented Sep 5, 2019

Very nice, thanks!

@ExE-Boss
Copy link
Collaborator

ExE-Boss commented Sep 6, 2019

The next step would probably be to generate a source map as well.

@ExE-Boss ExE-Boss merged commit 09c0f51 into mde:master Sep 10, 2019
@5im-0n 5im-0n deleted the debug branch October 11, 2019 12:22
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

Successfully merging this pull request may close these issues.

3 participants