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

Generate source maps from Handlebars plugin #25

Merged
merged 1 commit into from
Dec 2, 2023

Conversation

mbland
Copy link
Owner

@mbland mbland commented Dec 2, 2023

After thinking on it some more, I decided having source maps might be nice. Also, after reading the following, I realized it's actually quite expected:

Some helpful resources on source maps:

After thinking on it some more, I decided having source maps might be
nice. Also, after reading the following, I realized it's actually quite
expected:

- https://rollupjs.org/troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect

Some helpful resources on source maps:

- https://web.dev/articles/source-maps
- https://developer.chrome.com/docs/devtools/javascript/source-maps/
- https://www.npmjs.com/package/magic-string
@mbland mbland merged commit b3dee43 into main Dec 2, 2023
3 checks passed
@mbland mbland deleted the handlebars-plugin-source-maps branch December 2, 2023 03:40
mbland added a commit that referenced this pull request Dec 2, 2023
Removed PluginTmpl.#options, which became obsolete in #25 (commit
e768bcc).

Made PluginImpl.#hasHelpers() and PluginImpl.#partialRegistration()
private.

Return the source map object from PluginImpl.#adjustSourceMap() instead
of a JSON.stringified version. Though Handlebars.precompile() emits the
source map as a string, I'm pretty sure Vite+Rollups ends up parsing it.
Since #adjustSourceMap() already JSON.parses the string into an object,
it seems worth returning the object instead of a string.
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.

1 participant