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

Cannot define template string #4097

Open
hesxenon opened this issue Feb 26, 2025 · 1 comment
Open

Cannot define template string #4097

hesxenon opened this issue Feb 26, 2025 · 1 comment

Comments

@hesxenon
Copy link

It seems there is currently no way to define template strings.

https://esbuild.github.io/try/#dAAwLjI1LjAALS1kZWZpbmU6Rk9PPSdgZm9vYCcA

I would like this option to inject HTML templates into a bundle at build time (don't ask why, constraints and such...).

My current workaround is to join all lines in the template and sanitize the string so that special chars are escaped. Works, but is a bit more tedious than simply passing a template literal.

@hyrious
Copy link

hyrious commented Feb 26, 2025

For complex variable replacing cases, a common solution in esbuild is using the inject option to provide the implementation in a real js file, example.

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

2 participants