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

precompile partials with partials #1149

Open
forzatos opened this issue Oct 18, 2024 · 0 comments
Open

precompile partials with partials #1149

forzatos opened this issue Oct 18, 2024 · 0 comments

Comments

@forzatos
Copy link

forzatos commented Oct 18, 2024

Is there a way to precompile a partial that includes partials?

example:

<script>
{{precompile "application/templates/html/partial-one"}}
</script>

if partial-one.hbs includes something like this:

<div class="test">
   {{> application/templates/html/partial-test-one}}
   {{> application/templates/html/partial-test-two}}
</div>

the precompiled snippet will fail if i try to load data into it like this:

const template = Handlebars.templates['application/templates/html/partial-one'];
template(data);

It will complain about missing partial-test-one / partial-test-two.

All of this makes sense... But is there a way to force the precompile to also precompile all included child partials?

Maybe the easiest way is to create a new helper and register it or even extend existing one?!

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

1 participant