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

Show compiled templates in debugger #456

Merged
merged 1 commit into from
Sep 10, 2019
Merged

Show compiled templates in debugger #456

merged 1 commit into from
Sep 10, 2019

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